pub struct Settings {
pub server: Option<Server>,
pub data: Option<Data>,
pub metrics: Option<Metrics>,
pub security: Option<Security>,
}Expand description
Global application settings.
Root configuration structure that aggregates server, data, and metrics configurations.
Fields§
§server: Option<Server>Server configuration.
data: Option<Data>Data layer configuration.
metrics: Option<Metrics>Metrics configuration.
security: Option<Security>Security configuration.
Implementations§
Source§impl Settings
impl Settings
Sourcepub fn new(config_path: &str) -> Result<Self>
pub fn new(config_path: &str) -> Result<Self>
Loads the application settings from a configuration file.
This function reads the configuration from the specified file path,
deserializes it into the Settings structure, and returns it.
§Arguments
config_path- A string slice that holds the path to the configuration file.
§Returns
Result<Settings, ConfigError>- The loaded settings or an error if loading fails.
Sourcepub fn get_oauth2_config(&self) -> Option<OAuth2Configuration>
pub fn get_oauth2_config(&self) -> Option<OAuth2Configuration>
Returns the OAuth2 configuration object if available.
§Returns
Option<OAuth2Configuration>- The OAuth2 configuration if present,Noneotherwise.
Sourcepub fn get_auth2_public_key(&self, kid: &str) -> Option<Jwk>
pub fn get_auth2_public_key(&self, kid: &str) -> Option<Jwk>
Sourcepub fn get_auth2_token_url(&self) -> Option<String>
pub fn get_auth2_token_url(&self) -> Option<String>
Returns the OAuth2 token endpoint URL if available.
§Returns
Option<String>- The OAuth2 token endpoint URL if present,Noneotherwise.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Settings
impl<'de> Deserialize<'de> for Settings
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 Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnsafeUnpin for Settings
impl UnwindSafe for Settings
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> 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 moreSource§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