Struct littlefs2::path::Path

source ·
pub struct Path { /* private fields */ }
Expand description

A path

Paths must be null terminated ASCII strings

This assumption is not needed for littlefs itself (it works like Linux and accepts arbitrary C strings), but the assumption makes AsRef<str> trivial to implement.

Implementations§

source§

impl Path

source

pub const fn from_str_with_nul(s: &str) -> &Self

Creates a path from a string.

The string must only consist of ASCII characters, expect for the last character which must be null. If these conditions are not met, this function panics.

source

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

Creates a path from a byte buffer

The buffer will be first interpreted as a CStr and then checked to be comprised only of ASCII characters.

source

pub const unsafe fn from_bytes_with_nul_unchecked(bytes: &[u8]) -> &Self

Unchecked version of from_bytes_with_nul

Safety

bytes must be null terminated string comprised of only ASCII characters

source

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

Creates a path from a C string

The string will be checked to be comprised only of ASCII characters

source

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

Unchecked version of from_cstr

Safety

cstr must be comprised only of ASCII characters

source

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

Creates an owned PathBuf with path adjoined to self.

source

pub fn exists<S: Storage>(&self, fs: &Filesystem<'_, S>) -> bool

source

pub fn as_str_ref_with_trailing_nul(&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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialEq<Path> for Path

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method 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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

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

§

type Error = Error

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

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

Performs the conversion.
source§

impl Eq for Path

source§

impl StructuralEq for Path

source§

impl StructuralPartialEq for Path

Auto Trait Implementations§

§

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 Twhere
T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

const: unstable · source§

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

Mutably borrows from an owned value. Read more