pub struct AppContext {
pub cwd: Utf8PathBuf,
pub verbosity: u8,
}Expand description
The resolved invocation environment.
Fields§
§cwd: Utf8PathBufThe working directory the process was invoked from.
verbosity: u8The -v flag count.
Implementations§
Source§impl AppContext
impl AppContext
Sourcepub fn new(verbosity: u8) -> Result<Self, AppError>
pub fn new(verbosity: u8) -> Result<Self, AppError>
Resolve the context from the process environment.
§Errors
AppError::Io when the working directory cannot be read, and
AppError::Usage when its path is not UTF-8.
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 (const: unstable) · 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 UnsafeUnpin 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