pub struct Git2DBConfig {
pub repository: RepositoryConfig,
pub network: NetworkConfig,
pub performance: PerformanceConfig,
pub signature: GitSignature,
pub worktree: WorktreeConfig,
pub gittorrent: GitTorrentConfig,
pub xet: XetConfig,
}Expand description
Main configuration for git2db operations
Fields§
§repository: RepositoryConfigRepository management configuration
network: NetworkConfigNetwork and authentication configuration
performance: PerformanceConfigPerformance and caching configuration
signature: GitSignatureDefault signature for commits
worktree: WorktreeConfigWorktree strategy configuration
gittorrent: GitTorrentConfigGitTorrent P2P transport configuration (optional, requires gittorrent-transport feature)
xet: XetConfigXET large file storage configuration (optional, requires xet-storage feature)
Implementations§
Source§impl Git2DBConfig
impl Git2DBConfig
Sourcepub fn builder() -> Result<ConfigBuilder<DefaultState>>
pub fn builder() -> Result<ConfigBuilder<DefaultState>>
Create a configuration builder with git2db defaults
Returns the native config::ConfigBuilder for maximum flexibility.
This follows the same pattern as gittorrent for consistency.
Default Priority Order (highest to lowest):
- Programmatic overrides (
.set_override()) - Environment variables (
GIT2DB__*) - Config file (
~/.config/git2db/config.toml) - Default values
§Basic Usage
ⓘ
use git2db::config::Git2DBConfig;
// Simple case - use defaults
let config: Git2DBConfig = Git2DBConfig::builder()?
.build()?
.try_deserialize()?;§Programmatic Overrides
ⓘ
use git2db::config::Git2DBConfig;
let config: Git2DBConfig = Git2DBConfig::builder()?
.set_override("network.timeout_secs", 60)?
.set_override("performance.max_repo_cache", 200)?
.build()?
.try_deserialize()?;§Custom Config Sources
ⓘ
use git2db::config::Git2DBConfig;
use config::File;
let config: Git2DBConfig = Git2DBConfig::builder()?
.add_source(File::with_name("/custom/config")) // Highest priority
.build()?
.try_deserialize()?;§Supported Environment Variables
GIT2DB_REPOSITORY__PREFER_SHALLOW: Enable shallow clones (bool)GIT2DB_REPOSITORY__AUTO_INIT_SUBMODULES: Auto-init submodules on open (bool)GIT2DB_NETWORK__TIMEOUT_SECS: Network timeout in seconds (u64)GIT2DB_PERFORMANCE__MAX_REPO_CACHE: Max cached repos (usize)GIT2DB_SIGNATURE__NAME: Git commit author nameGIT2DB_SIGNATURE__EMAIL: Git commit author emailGIT2DB_WORKTREE__DRIVER: Storage driver selection (overlay2, vfs, reflink)GIT2DB_WORKTREE__LOG_DRIVER: Log driver selection decisions (bool)GIT2DB_GITTORRENT__P2P_PORT: GitTorrent P2P port (requires feature)
Trait Implementations§
Source§impl Clone for Git2DBConfig
impl Clone for Git2DBConfig
Source§fn clone(&self) -> Git2DBConfig
fn clone(&self) -> Git2DBConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Git2DBConfig
impl Debug for Git2DBConfig
Source§impl Default for Git2DBConfig
impl Default for Git2DBConfig
Source§fn default() -> Git2DBConfig
fn default() -> Git2DBConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for Git2DBConfig
impl<'de> Deserialize<'de> for Git2DBConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Git2DBConfig
impl RefUnwindSafe for Git2DBConfig
impl Send for Git2DBConfig
impl Sync for Git2DBConfig
impl Unpin for Git2DBConfig
impl UnsafeUnpin for Git2DBConfig
impl UnwindSafe for Git2DBConfig
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more