pub struct ManifestPath { /* private fields */ }Expand description
Path to a Cargo.toml file
Implementations§
Source§impl ManifestPath
impl ManifestPath
Sourcepub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn new<P: AsRef<Path>>(path: P) -> Result<Self>
Create a new ManifestPath, errors if not path to Cargo.toml
Sourcepub fn directory(&self) -> Option<&Path>
pub fn directory(&self) -> Option<&Path>
The directory path of the manifest path.
Returns None if the path is just the plain file name Cargo.toml
Sourcepub fn absolute_directory(&self) -> Result<PathBuf, Error>
pub fn absolute_directory(&self) -> Result<PathBuf, Error>
Returns the absolute directory path of the manifest.
Trait Implementations§
Source§impl AsRef<Path> for ManifestPath
impl AsRef<Path> for ManifestPath
Source§impl Clone for ManifestPath
impl Clone for ManifestPath
Source§fn clone(&self) -> ManifestPath
fn clone(&self) -> ManifestPath
Returns a copy 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 moreSource§impl Debug for ManifestPath
impl Debug for ManifestPath
Source§impl Default for ManifestPath
impl Default for ManifestPath
Source§fn default() -> ManifestPath
fn default() -> ManifestPath
Returns the “default value” for a type. Read more
Source§impl From<ManifestPath> for PathBuf
impl From<ManifestPath> for PathBuf
Source§fn from(path: ManifestPath) -> Self
fn from(path: ManifestPath) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ManifestPath
impl RefUnwindSafe for ManifestPath
impl Send for ManifestPath
impl Sync for ManifestPath
impl Unpin for ManifestPath
impl UnwindSafe for ManifestPath
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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