pub struct CrateName(/* private fields */);Expand description
A crate name.
Implementations§
Source§impl CrateName
impl CrateName
pub const fn new(name: String) -> Self
Sourcepub fn find_crate_name(path: &Path) -> Option<Self>
pub fn find_crate_name(path: &Path) -> Option<Self>
Extract the crate name from a give path to a rust source file. This is
defined as the name of the directory one level above the src directory
that cotains this source file, with any - replaced with _.
Trait Implementations§
Source§impl Ord for CrateName
impl Ord for CrateName
Source§impl PartialOrd for CrateName
impl PartialOrd for CrateName
impl Eq for CrateName
impl StructuralPartialEq for CrateName
Auto Trait Implementations§
impl Freeze for CrateName
impl RefUnwindSafe for CrateName
impl Send for CrateName
impl Sync for CrateName
impl Unpin for CrateName
impl UnwindSafe for CrateName
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> 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