pub struct Settings {
pub mode: Mode,
pub name: String,
pub network: NetworkConfig,
pub scope: Scope,
pub services: ServicesConfig,
pub version: String,
pub workspace: WorkspaceConfig,
}Fields§
§mode: Mode§name: String§network: NetworkConfig§scope: Scope§services: ServicesConfig§version: String§workspace: WorkspaceConfigImplementations§
Source§impl Settings
impl Settings
pub const DEFAULT_MODE: Mode = Mode::Debug
pub const APP_NAME: &'static str = "arachnid"
Sourcepub fn new() -> Self
pub fn new() -> Self
attempts to initialize a build a new instance of the configuration,
falling back to the logical default if unsuccessful
Sourcepub fn from_mode(mode: Mode) -> Self
pub fn from_mode(mode: Mode) -> Self
initialize a new instance of the settings from the given Mode
Sourcepub fn build() -> Result<Self, ConfigError>
pub fn build() -> Result<Self, ConfigError>
tries to build the settings from the configuration sources
Sourcepub const fn network(&self) -> &NetworkConfig
pub const fn network(&self) -> &NetworkConfig
returns a reference to the network configuration
Sourcepub const fn network_mut(&mut self) -> &mut NetworkConfig
pub const fn network_mut(&mut self) -> &mut NetworkConfig
returns a mutable reference to the network configuration
Sourcepub const fn scope_mut(&mut self) -> &mut Scope
pub const fn scope_mut(&mut self) -> &mut Scope
returns a mutable reference to the current scope
Sourcepub const fn services(&self) -> &ServicesConfig
pub const fn services(&self) -> &ServicesConfig
returns a reference to the services
Sourcepub const fn services_mut(&mut self) -> &mut ServicesConfig
pub const fn services_mut(&mut self) -> &mut ServicesConfig
returns a mutable reference to the services
Sourcepub const fn workspace(&self) -> &WorkspaceConfig
pub const fn workspace(&self) -> &WorkspaceConfig
returns a reference to the workspace
Sourcepub const fn workspace_mut(&mut self) -> &mut WorkspaceConfig
pub const fn workspace_mut(&mut self) -> &mut WorkspaceConfig
returns a mutable reference to the workspace
Sourcepub async fn bind(&self) -> Result<TcpListener>
pub async fn bind(&self) -> Result<TcpListener>
attempts to bind a TcpListener to the configured network
address.
Sourcepub fn init_tracing(&self)
pub fn init_tracing(&self)
Initialize tracing modules
Sourcepub fn set_workdir<T>(&mut self, workdir: T)
pub fn set_workdir<T>(&mut self, workdir: T)
set the working directory of the scope
Sourcepub fn set_workdir_option<T>(&mut self, workdir: Option<T>)
pub fn set_workdir_option<T>(&mut self, workdir: Option<T>)
if the workdir is set, set it to the given workdir
pub fn set_port(&mut self, port: u16)
pub fn set_log_level(&mut self, level: LogLevel)
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
Source§impl Ord for Settings
impl Ord for Settings
Source§impl PartialOrd for Settings
impl PartialOrd for Settings
impl Eq for Settings
impl StructuralPartialEq for Settings
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin 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