pub struct Pivot;
Expand description
Implementations§
Source§impl Pivot
impl Pivot
Sourcepub fn resolve() -> PathBuf
pub fn resolve() -> PathBuf
Resolves the pivot directory at runtime, which is the directory relative to which the file queries are normally performed.
Example: the config directory, when given as a relative path, is resolved relative to the pivot directory.
When running a binary in a development environment (e.g.: using
cargo run
, cargo test
, or from an IDE), the pivot directory is the
directory containing the crate’s Cargo.toml
file. This is detected by
reading the CARGO_MANIFEST_DIR
environment variable at runtime.
When running a binary without using cargo
(e.g., by executing the
binary in production), the CARGO_MANIFEST_DIR
environment variable is
normally not set, and the pivot directory is the process’s
current working directory.
Auto Trait Implementations§
impl Freeze for Pivot
impl RefUnwindSafe for Pivot
impl Send for Pivot
impl Sync for Pivot
impl Unpin for Pivot
impl UnwindSafe for Pivot
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