pub struct GlobalConfig {
pub client: ClientGlobalConfig,
pub streaming: StreamingGlobalConfig,
pub logging: LoggingConfig,
pub features: FeatureFlags,
}Expand description
Global configuration for kode-bridge
Fields§
§client: ClientGlobalConfigDefault client configuration
streaming: StreamingGlobalConfigStreaming client configuration
logging: LoggingConfigLogging configuration
features: FeatureFlagsFeature flags
Implementations§
Source§impl GlobalConfig
impl GlobalConfig
Sourcepub fn from_toml_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_toml_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load configuration from a TOML file
Sourcepub fn from_json_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_json_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load configuration from a JSON file
Sourcepub fn save_toml_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn save_toml_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
Save configuration to a TOML file
Sourcepub fn save_json_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn save_json_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
Save configuration to a JSON file
Sourcepub fn apply_env_overrides(&mut self)
pub fn apply_env_overrides(&mut self)
Apply environment variable overrides
Sourcepub const fn client_timeout(&self) -> Duration
pub const fn client_timeout(&self) -> Duration
Convert client timeout to Duration
Sourcepub const fn streaming_timeout(&self) -> Duration
pub const fn streaming_timeout(&self) -> Duration
Convert streaming timeout to Duration
Sourcepub const fn retry_delay(&self) -> Duration
pub const fn retry_delay(&self) -> Duration
Convert retry delay to Duration
Sourcepub const fn connection_timeout(&self) -> Duration
pub const fn connection_timeout(&self) -> Duration
Convert connection timeout to Duration
Sourcepub fn is_feature_enabled(&self, feature: &str) -> bool
pub fn is_feature_enabled(&self, feature: &str) -> bool
Check if feature is enabled
Trait Implementations§
Source§impl Clone for GlobalConfig
impl Clone for GlobalConfig
Source§fn clone(&self) -> GlobalConfig
fn clone(&self) -> GlobalConfig
Returns a duplicate of the value. Read more
1.0.0 · 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 GlobalConfig
impl Debug for GlobalConfig
Source§impl Default for GlobalConfig
impl Default for GlobalConfig
Source§fn default() -> GlobalConfig
fn default() -> GlobalConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GlobalConfig
impl<'de> Deserialize<'de> for GlobalConfig
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 GlobalConfig
impl RefUnwindSafe for GlobalConfig
impl Send for GlobalConfig
impl Sync for GlobalConfig
impl Unpin for GlobalConfig
impl UnwindSafe for GlobalConfig
Blanket Implementations§
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