pub struct CurrentWorkingDirectory(/* private fields */);Expand description
The working directory in which a command was called
The current working directory is the directory from which Clawless commands are run. It is
passed to commands via the Context struct, allowing commands to operate relative to this
directory.
Please note that the path is not updated if commands manually change into another directory.
Implementations§
Source§impl CurrentWorkingDirectory
impl CurrentWorkingDirectory
Source§impl CurrentWorkingDirectory
impl CurrentWorkingDirectory
Sourcepub fn try_from_env() -> Result<CurrentWorkingDirectory, ContextError>
pub fn try_from_env() -> Result<CurrentWorkingDirectory, ContextError>
Creates a CurrentWorkingDirectory from the environment
This function retrieves the current working directory from the environment and creates a
CurrentWorkingDirectory instance. If the current directory cannot be determined, an error
is returned.
§Errors
Returns std::io::Error if the current directory cannot be determined from the
environment.
Trait Implementations§
Source§impl Clone for CurrentWorkingDirectory
impl Clone for CurrentWorkingDirectory
Source§fn clone(&self) -> CurrentWorkingDirectory
fn clone(&self) -> CurrentWorkingDirectory
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 moreSource§impl Debug for CurrentWorkingDirectory
impl Debug for CurrentWorkingDirectory
Source§impl Display for CurrentWorkingDirectory
impl Display for CurrentWorkingDirectory
impl Eq for CurrentWorkingDirectory
Source§impl From<&Path> for CurrentWorkingDirectory
impl From<&Path> for CurrentWorkingDirectory
Source§fn from(path: &Path) -> CurrentWorkingDirectory
fn from(path: &Path) -> CurrentWorkingDirectory
Converts to this type from the input type.
Source§impl From<&str> for CurrentWorkingDirectory
impl From<&str> for CurrentWorkingDirectory
Source§fn from(string: &str) -> CurrentWorkingDirectory
fn from(string: &str) -> CurrentWorkingDirectory
Converts to this type from the input type.
Source§impl From<String> for CurrentWorkingDirectory
impl From<String> for CurrentWorkingDirectory
Source§fn from(string: String) -> CurrentWorkingDirectory
fn from(string: String) -> CurrentWorkingDirectory
Converts to this type from the input type.
Source§impl Hash for CurrentWorkingDirectory
impl Hash for CurrentWorkingDirectory
Source§impl Ord for CurrentWorkingDirectory
impl Ord for CurrentWorkingDirectory
Source§fn cmp(&self, other: &CurrentWorkingDirectory) -> Ordering
fn cmp(&self, other: &CurrentWorkingDirectory) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for CurrentWorkingDirectory
impl PartialEq for CurrentWorkingDirectory
Source§impl PartialOrd for CurrentWorkingDirectory
impl PartialOrd for CurrentWorkingDirectory
impl StructuralPartialEq for CurrentWorkingDirectory
Auto Trait Implementations§
impl Freeze for CurrentWorkingDirectory
impl RefUnwindSafe for CurrentWorkingDirectory
impl Send for CurrentWorkingDirectory
impl Sync for CurrentWorkingDirectory
impl Unpin for CurrentWorkingDirectory
impl UnsafeUnpin for CurrentWorkingDirectory
impl UnwindSafe for CurrentWorkingDirectory
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