pub struct NetworkConfig {
pub timeout_secs: u64,
pub max_retries: usize,
pub retry_base_delay_ms: u64,
pub retry_max_delay_secs: u64,
pub proxy_url: Option<String>,
pub user_agent: String,
pub use_credential_helper: bool,
pub access_token: Option<String>,
pub access_token_host: Option<String>,
}Expand description
Network and authentication configuration
Field naming convention: All timeout/duration fields use unit suffixes:
*_secs= seconds (u64)*_ms= milliseconds (u64)
This ensures clear time unit specification in configuration files and environment variables.
Fields§
§timeout_secs: u64Network timeout for operations (in seconds)
max_retries: usizeMaximum retry attempts for network operations
retry_base_delay_ms: u64Base delay for exponential backoff (in milliseconds)
retry_max_delay_secs: u64Maximum delay between retries (in seconds)
proxy_url: Option<String>Proxy configuration
user_agent: StringUser agent for HTTP requests
use_credential_helper: boolEnable git credential helper (default credentials) This allows using system git credentials, SSH agents, etc.
access_token: Option<String>Personal access token (e.g., for GitHub, GitLab, Hugging Face) Can also be set via GIT2DB_NETWORK__ACCESS_TOKEN env var
access_token_host: Option<String>The exact origin host (e.g. "github.com") that access_token is
bound to. When set, the default clone path attaches the token scoped to
this host — it is only offered to a remote whose URL host matches. When
unset, the token is not attached to the default clone path at all
(fail-closed against exfiltration to a caller-selected remote). See
issue #1429.
Trait Implementations§
Source§impl Clone for NetworkConfig
impl Clone for NetworkConfig
Source§fn clone(&self) -> NetworkConfig
fn clone(&self) -> NetworkConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NetworkConfig
impl Debug for NetworkConfig
Source§impl Default for NetworkConfig
impl Default for NetworkConfig
Source§impl<'de> Deserialize<'de> for NetworkConfig
impl<'de> Deserialize<'de> for NetworkConfig
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>,
Auto Trait Implementations§
impl Freeze for NetworkConfig
impl RefUnwindSafe for NetworkConfig
impl Send for NetworkConfig
impl Sync for NetworkConfig
impl Unpin for NetworkConfig
impl UnsafeUnpin for NetworkConfig
impl UnwindSafe for NetworkConfig
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
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>
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>
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