pub struct AppConfig {
pub app_name: Stringy,
pub version: String,
pub max_ram_usage: usize,
pub max_cpu_usage: usize,
pub environment: String,
pub debug_mode: bool,
pub log_level: LogLevel,
pub git: Option<GitConfig>,
pub database: Option<DatabaseConfig>,
pub aggregator: Option<Aggregator>,
}Expand description
Represents the application’s configuration settings.
Fields§
§app_name: StringyA name for the application instance.
version: StringVersion of the application.
max_ram_usage: usizeMaximum ram usage in MB
max_cpu_usage: usizeMaximum cpu time usage This would be practically be used to restart a service when it gets to it’s aloted cpu time. A pricing scale be set like this.
environment: StringThe environment the application is running in (e.g., development, staging, production).
debug_mode: boolOptional setting for enabling debug mode.
log_level: LogLevelSettings for what information is logged
git: Option<GitConfig>Configuration related to the Git functionality.
database: Option<DatabaseConfig>Configuration related to the database (optional example).
aggregator: Option<Aggregator>Configuration for Aggregator communication
Implementations§
Source§impl AppConfig
impl AppConfig
Sourcepub fn new() -> Result<Self, ConfigError>
pub fn new() -> Result<Self, ConfigError>
pub fn get_version(&self) -> Result<SoftwareVersion, ErrorArrayItem>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AppConfig
impl<'de> Deserialize<'de> for AppConfig
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
Source§impl Ord for AppConfig
impl Ord for AppConfig
Source§impl PartialOrd for AppConfig
impl PartialOrd for AppConfig
impl Eq for AppConfig
impl StructuralPartialEq for AppConfig
Auto Trait Implementations§
impl Freeze for AppConfig
impl RefUnwindSafe for AppConfig
impl Send for AppConfig
impl Sync for AppConfig
impl Unpin for AppConfig
impl UnwindSafe for AppConfig
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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 more