pub struct CargoEnv { /* private fields */ }Expand description
Provides access to cargo environment variables. Getting an instance of this struct guarantees the existence of cargo related variables
Implementations§
Source§impl CargoEnv
impl CargoEnv
Sourcepub fn get_entry<S>(&self, key: S) -> Option<&str>
pub fn get_entry<S>(&self, key: S) -> Option<&str>
Get an entry by name. The name is automatically converted into upper snake case.
If the key is not immediately available, CARGO_ is appended to the front and that is also searched.
Sourcepub fn package_name(&self) -> &str
pub fn package_name(&self) -> &str
Gets the name of the current package
Sourcepub fn manifest_directory(&self) -> PathBuf
pub fn manifest_directory(&self) -> PathBuf
Gets the manifest directory
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CargoEnv
impl RefUnwindSafe for CargoEnv
impl Send for CargoEnv
impl Sync for CargoEnv
impl Unpin for CargoEnv
impl UnwindSafe for CargoEnv
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> InstanceOf for T
impl<T> InstanceOf for T
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