pub struct EntryPath { /* private fields */ }
Implementations§
Source§impl EntryPath
impl EntryPath
Sourcepub fn calc_crc<T: AsRef<str>>(parts: &[T]) -> Option<u16>
pub fn calc_crc<T: AsRef<str>>(parts: &[T]) -> Option<u16>
Calculate crc given parts of path
Crc is XOR of crc of individual parts
Returns None
if given slice is empty
Sourcepub fn from<P1: AsRef<Path>, P2: AsRef<Path>>(
root: P1,
path: P2,
) -> Option<Self>
pub fn from<P1: AsRef<Path>, P2: AsRef<Path>>( root: P1, path: P2, ) -> Option<Self>
Create new entry path from Path
and root
Returns None
if path doesn’t start from root or if it contains non unicode characters
and can’t be represented as String
pub fn parts(&self) -> &[String]
Trait Implementations§
Source§impl PartialOrd for EntryPath
path1 < path2 if path2 contains path1.
Example:
/data < /data/test
/mnt/file > /mnt
/mnt == /mnt
impl PartialOrd for EntryPath
path1 < path2 if path2 contains path1. Example: /data < /data/test /mnt/file > /mnt /mnt == /mnt
For different paths result is None Example: partial_cmp(/mnt/data, /mnt/test) == None
impl Eq for EntryPath
impl StructuralPartialEq for EntryPath
Auto Trait Implementations§
impl Freeze for EntryPath
impl RefUnwindSafe for EntryPath
impl Send for EntryPath
impl Sync for EntryPath
impl Unpin for EntryPath
impl UnwindSafe for EntryPath
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