pub struct RepoPathComponent { /* private fields */ }
Expand description
Borrowed RepoPath
component.
Implementations§
Source§impl RepoPathComponent
impl RepoPathComponent
Sourcepub fn new(value: &str) -> Result<&Self, InvalidNewRepoPathError>
pub fn new(value: &str) -> Result<&Self, InvalidNewRepoPathError>
Wraps value
as RepoPathComponent
.
Returns an error if the input value
is empty or contains path
separator.
Sourcepub fn as_internal_str(&self) -> &str
pub fn as_internal_str(&self) -> &str
Returns the underlying string representation.
Sourcepub fn to_fs_name(&self) -> Result<&str, InvalidRepoPathComponentError>
pub fn to_fs_name(&self) -> Result<&str, InvalidRepoPathComponentError>
Returns a normal filesystem entry name if this path component is valid as a file/directory name.
Trait Implementations§
Source§impl AsRef<RepoPathComponent> for RepoPathComponent
impl AsRef<RepoPathComponent> for RepoPathComponent
Source§fn as_ref(&self) -> &RepoPathComponent
fn as_ref(&self) -> &RepoPathComponent
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl AsRef<RepoPathComponent> for RepoPathComponentBuf
impl AsRef<RepoPathComponent> for RepoPathComponentBuf
Source§fn as_ref(&self) -> &RepoPathComponent
fn as_ref(&self) -> &RepoPathComponent
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Borrow<RepoPathComponent> for RepoPathComponentBuf
impl Borrow<RepoPathComponent> for RepoPathComponentBuf
Source§fn borrow(&self) -> &RepoPathComponent
fn borrow(&self) -> &RepoPathComponent
Immutably borrows from an owned value. Read more
Source§impl Debug for RepoPathComponent
impl Debug for RepoPathComponent
Source§impl Hash for RepoPathComponent
impl Hash for RepoPathComponent
Source§impl Ord for RepoPathComponent
impl Ord for RepoPathComponent
Source§impl PartialEq for RepoPathComponent
impl PartialEq for RepoPathComponent
Source§impl PartialOrd for RepoPathComponent
impl PartialOrd for RepoPathComponent
Source§impl ToOwned for RepoPathComponent
impl ToOwned for RepoPathComponent
Source§type Owned = RepoPathComponentBuf
type Owned = RepoPathComponentBuf
The resulting type after obtaining ownership.
Source§fn to_owned(&self) -> Self::Owned
fn to_owned(&self) -> Self::Owned
Creates owned data from borrowed data, usually by cloning. Read more
Source§fn clone_into(&self, target: &mut Self::Owned)
fn clone_into(&self, target: &mut Self::Owned)
Uses borrowed data to replace owned data, usually by cloning. Read more
impl Eq for RepoPathComponent
impl StructuralPartialEq for RepoPathComponent
Auto Trait Implementations§
impl Freeze for RepoPathComponent
impl RefUnwindSafe for RepoPathComponent
impl Send for RepoPathComponent
impl !Sized for RepoPathComponent
impl Sync for RepoPathComponent
impl Unpin for RepoPathComponent
impl UnwindSafe for RepoPathComponent
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<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.