pub struct WorktreeName(/* private fields */);Expand description
A node’s name for its tree. A newtype because this string becomes a directory name and a git reference: the two ways it can be malformed are checked once, here.
Implementations§
Source§impl WorktreeName
impl WorktreeName
Sourcepub fn parse(raw: &str) -> Result<WorktreeName, StorageError>
pub fn parse(raw: &str) -> Result<WorktreeName, StorageError>
§Errors
Refuses an empty name, a path separator, a leading dot, and any
character outside [A-Za-z0-9._-]. A name that walks out of its
directory is the whole isolation guarantee walking out with it.
pub fn as_str(&self) -> &str
Trait Implementations§
Source§impl Clone for WorktreeName
impl Clone for WorktreeName
Source§impl Debug for WorktreeName
impl Debug for WorktreeName
impl Eq for WorktreeName
Source§impl Ord for WorktreeName
impl Ord for WorktreeName
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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl PartialEq for WorktreeName
impl PartialEq for WorktreeName
Source§impl PartialOrd for WorktreeName
impl PartialOrd for WorktreeName
impl StructuralPartialEq for WorktreeName
Auto Trait Implementations§
impl Freeze for WorktreeName
impl RefUnwindSafe for WorktreeName
impl Send for WorktreeName
impl Sync for WorktreeName
impl Unpin for WorktreeName
impl UnsafeUnpin for WorktreeName
impl UnwindSafe for WorktreeName
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