Path

Struct Path 

Source
pub struct Path { /* private fields */ }
Expand description

A path

Paths must be null terminated ASCII strings with at most PathBuf::MAX_SIZE bytes (not including the trailing null).

Implementations§

Source§

impl Path

Source

pub const fn const_eq(&self, path: &Path) -> bool

Checks two paths for equality.

This provides an easy way to check paths in a const context.

§Example
const fn check(path: &Path) -> bool {
    !path.const_eq(path!("forbidden-path"))
}

assert!(check(path!("allowed-path")));
assert!(!check(path!("forbidden-path")));
Source

pub fn cmp_str(&self, other: &Path) -> Ordering

Compare the path using their string representation This comarison function as would be expected for a String type.

This ordering does not match the ordering obsvered when iterating over a directory.

See cmp_lfs and littlefs#923.

assert_eq!(path!("some_path_a").cmp_str(path!("some_path_b")), Ordering::Less);
assert_eq!(path!("some_path_b").cmp_str(path!("some_path_a")), Ordering::Greater);
assert_eq!(path!("some_path").cmp_str(path!("some_path_a")), Ordering::Less);
assert_eq!(path!("some_path").cmp_str(path!("some_path_b")), Ordering::Less);
assert_eq!(path!("some_path").cmp_str(path!("some_path")), Ordering::Equal);
Source

pub fn cmp_lfs(&self, other: &Path) -> Ordering

Compare the path using their string representation

This comparison function matches the iteration order of littlefs when iterating over directory. For more information, see littlefs#923

assert_eq!(path!("some_path_a").cmp_lfs(path!("some_path_b")), Ordering::Less);
assert_eq!(path!("some_path_b").cmp_lfs(path!("some_path_a")), Ordering::Greater);
assert_eq!(path!("some_path").cmp_lfs(path!("some_path_a")), Ordering::Greater);
assert_eq!(path!("some_path").cmp_lfs(path!("some_path_b")), Ordering::Greater);
assert_eq!(path!("some_path_a").cmp_lfs(path!("some_path")), Ordering::Less);
assert_eq!(path!("some_path_b").cmp_lfs(path!("some_path")), Ordering::Less);
assert_eq!(path!("some_path").cmp_lfs(path!("some_path")), Ordering::Equal);
Source§

impl Path

Source

pub const fn is_empty(&self) -> bool

Return true if the path is empty


assert!(path!("").is_empty());
assert!(!path!("something").is_empty());
Source

pub fn file_name(&self) -> Option<&Path>

Get the name of the file this path points to if it points to one

let path = path!("/some/path/file.extension");
assert_eq!(path.file_name(), Some(path!("file.extension")));

let path = path!("/");
assert_eq!(path.file_name(), None);

let path = path!("");
assert_eq!(path.file_name(), None);

let path = path!("/some/path/file.extension/");
assert_eq!(path.file_name(), None);
Source

pub fn ancestors(&self) -> Ancestors<'_>

Iterate over the ancestors of the path

let path = path!("/some/path/file.extension");
let mut ancestors = path.ancestors();
assert_eq!(&*ancestors.next().unwrap(), path!("/some/path/file.extension"));
assert_eq!(&*ancestors.next().unwrap(), path!("/some/path"));
assert_eq!(&*ancestors.next().unwrap(), path!("/some"));
assert_eq!(&*ancestors.next().unwrap(), path!("/"));
assert!(ancestors.next().is_none());
Source

pub fn iter(&self) -> Iter<'_>

Iterate over the components of the path

let path = path!("/some/path/file.extension");
let mut iter = path.iter();
assert_eq!(&*iter.next().unwrap(), path!("/"));
assert_eq!(&*iter.next().unwrap(), path!("some"));
assert_eq!(&*iter.next().unwrap(), path!("path"));
assert_eq!(&*iter.next().unwrap(), path!("file.extension"));
assert!(iter.next().is_none());
Source

pub const fn from_str_with_nul(s: &str) -> Result<&Self, PathError>

Creates a path from a string.

The string must only consist of ASCII characters. The last character must be null. It must contain at most PathBuf::MAX_SIZE bytes, not including the trailing null. If these conditions are not met, this function returns an error.

Source

pub const fn from_bytes_with_nul(bytes: &[u8]) -> Result<&Self, PathError>

Creates a path from a byte buffer.

The byte buffer must only consist of ASCII characters. The last character must be null. It must contain at most PathBuf::MAX_SIZE bytes, not including the trailing null. If these conditions are not met, this function returns an error.

Source

pub const fn from_cstr(cstr: &CStr) -> Result<&Self, PathError>

Creates a path from a C string.

The string must only consist of ASCII characters. It must contain at most PathBuf::MAX_SIZE bytes, not including the trailing null. If these conditions are not met, this function returns an error.

Source

pub const unsafe fn from_cstr_unchecked(cstr: &CStr) -> &Self

Creates a path from a C string without checking the invariants.

§Safety

The string must only consist of ASCII characters. It must contain at most PathBuf::MAX_SIZE bytes, not including the trailing null.

Source

pub const fn as_ptr(&self) -> *const c_char

Returns the inner pointer to this C string.

Source

pub fn join(&self, path: &Path) -> PathBuf

Creates an owned PathBuf with path adjoined to self.

Source

pub const fn as_str_ref_with_trailing_nul(&self) -> &str

Source

pub const fn as_str(&self) -> &str

Source

pub fn parent(&self) -> Option<PathBuf>

Trait Implementations§

Source§

impl AsRef<str> for Path

Source§

fn as_ref(&self) -> &str

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Debug for Path

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for Path

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Path> for PathBuf

Source§

fn from(path: &Path) -> Self

Converts to this type from the input type.
Source§

impl PartialEq<[u8; 1]> for Path

Source§

fn eq(&self, rhs: &[u8; 1]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 10]> for Path

Source§

fn eq(&self, rhs: &[u8; 10]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 11]> for Path

Source§

fn eq(&self, rhs: &[u8; 11]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 12]> for Path

Source§

fn eq(&self, rhs: &[u8; 12]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 13]> for Path

Source§

fn eq(&self, rhs: &[u8; 13]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 14]> for Path

Source§

fn eq(&self, rhs: &[u8; 14]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 15]> for Path

Source§

fn eq(&self, rhs: &[u8; 15]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 16]> for Path

Source§

fn eq(&self, rhs: &[u8; 16]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 17]> for Path

Source§

fn eq(&self, rhs: &[u8; 17]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 18]> for Path

Source§

fn eq(&self, rhs: &[u8; 18]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 19]> for Path

Source§

fn eq(&self, rhs: &[u8; 19]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 2]> for Path

Source§

fn eq(&self, rhs: &[u8; 2]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 20]> for Path

Source§

fn eq(&self, rhs: &[u8; 20]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 21]> for Path

Source§

fn eq(&self, rhs: &[u8; 21]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 22]> for Path

Source§

fn eq(&self, rhs: &[u8; 22]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 23]> for Path

Source§

fn eq(&self, rhs: &[u8; 23]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 24]> for Path

Source§

fn eq(&self, rhs: &[u8; 24]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 25]> for Path

Source§

fn eq(&self, rhs: &[u8; 25]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 26]> for Path

Source§

fn eq(&self, rhs: &[u8; 26]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 27]> for Path

Source§

fn eq(&self, rhs: &[u8; 27]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 28]> for Path

Source§

fn eq(&self, rhs: &[u8; 28]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 29]> for Path

Source§

fn eq(&self, rhs: &[u8; 29]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 3]> for Path

Source§

fn eq(&self, rhs: &[u8; 3]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 30]> for Path

Source§

fn eq(&self, rhs: &[u8; 30]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 31]> for Path

Source§

fn eq(&self, rhs: &[u8; 31]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 32]> for Path

Source§

fn eq(&self, rhs: &[u8; 32]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 4]> for Path

Source§

fn eq(&self, rhs: &[u8; 4]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 5]> for Path

Source§

fn eq(&self, rhs: &[u8; 5]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 6]> for Path

Source§

fn eq(&self, rhs: &[u8; 6]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 7]> for Path

Source§

fn eq(&self, rhs: &[u8; 7]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 8]> for Path

Source§

fn eq(&self, rhs: &[u8; 8]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<[u8; 9]> for Path

Source§

fn eq(&self, rhs: &[u8; 9]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<str> for Path

Source§

fn eq(&self, rhs: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for Path

Source§

fn eq(&self, other: &Path) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'b> TryFrom<&'b [u8]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 1]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 1]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 10]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 10]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 11]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 11]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 12]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 12]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 13]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 13]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 14]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 14]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 15]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 15]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 16]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 16]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 17]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 17]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 18]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 18]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 19]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 19]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 2]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 2]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 20]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 20]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 21]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 21]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 22]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 22]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 23]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 23]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 24]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 24]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 25]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 25]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 26]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 26]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 27]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 27]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 28]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 28]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 29]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 29]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 3]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 3]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 30]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 30]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 31]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 31]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 32]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 32]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 4]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 4]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 5]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 5]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 6]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 6]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 7]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 7]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 8]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 8]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl<'b> TryFrom<&'b [u8; 9]> for &'b Path

Source§

type Error = PathError

The type returned in the event of a conversion error.
Source§

fn try_from(bytes: &[u8; 9]) -> Result<&Path, PathError>

Performs the conversion.
Source§

impl Eq for Path

Source§

impl StructuralPartialEq for Path

Auto Trait Implementations§

§

impl Freeze for Path

§

impl RefUnwindSafe for Path

§

impl Send for Path

§

impl !Sized for Path

§

impl Sync for Path

§

impl Unpin for Path

§

impl UnwindSafe for Path

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more