pub struct Config {
pub transports: TransportConfig,
pub store: StoreConfig,
pub buffer_size: usize,
pub max_denied_keys: u32,
pub log_level: String,
}Expand description
Main configuration structure for the server
This structure is built from CLI arguments and environment variables, and contains all settings needed to run the server.
Fields§
§transports: TransportConfigTransport layer configuration
store: StoreConfigRate limiter store configuration
buffer_size: usizeChannel buffer size for actor communication
max_denied_keys: u32Maximum number of denied keys to track in metrics
log_level: StringLogging level (error, warn, info, debug, trace)
Implementations§
Source§impl Config
impl Config
Sourcepub fn from_env_and_args() -> Result<Self>
pub fn from_env_and_args() -> Result<Self>
Build configuration from environment variables and CLI arguments
This method:
- Parses CLI arguments (with env var fallback via clap)
- Handles special flags like –list-env-vars
- Builds the configuration structure
- Validates the configuration
§Errors
Returns an error if:
- No transport is specified
- Invalid configuration values are provided
Sourcepub fn has_any_transport(&self) -> bool
pub fn has_any_transport(&self) -> bool
Check if at least one transport is configured
The server requires at least one transport to be functional.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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 Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request