pub struct AppContext {
pub paths: ResolvedPaths,
pub sections: Vec<ConfigSection>,
pub root_from_env: bool,
pub log_level: Arc<str>,
pub file_log_level: Arc<str>,
pub verbosity: u8,
}Expand description
Runtime context for the application.
This contains configuration, paths, and logging setup that all commands need to operate.
Fields§
§paths: ResolvedPaths§sections: Vec<ConfigSection>§root_from_env: bool§log_level: Arc<str>§file_log_level: Arc<str>§verbosity: u8Implementations§
Source§impl AppContext
impl AppContext
pub fn from_config(config: &Config) -> Result<Self>
pub fn from_config_with_verbosity( config: &Config, verbosity: u8, ) -> Result<Self>
Trait Implementations§
Source§impl Clone for AppContext
impl Clone for AppContext
Source§fn clone(&self) -> AppContext
fn clone(&self) -> AppContext
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 moreAuto Trait Implementations§
impl Freeze for AppContext
impl RefUnwindSafe for AppContext
impl Send for AppContext
impl Sync for AppContext
impl Unpin for AppContext
impl UnwindSafe for AppContext
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