Struct littlefs2::path::Path[][src]

pub struct Path { /* fields omitted */ }

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

impl Path[src]

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

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.

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

Unchecked version of from_bytes_with_nul

Safety

bytes must be null terminated string comprised of only ASCII characters

pub fn from_cstr<'s>(cstr: &'s CStr) -> Result<&'s Self>[src]

Creates a path from a C string

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

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

Unchecked version of from_cstr

Safety

cstr must be comprised only of ASCII characters

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

Creates an owned PathBuf with path adjoined to self.

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

pub fn as_str_ref_with_trailing_nul(&self) -> &str[src]

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

Trait Implementations

impl AsRef<str> for Path[src]

impl Debug for Path[src]

impl Display for Path[src]

impl From<&'_ Path> for PathBuf[src]

impl PartialEq<[u8; 1]> for Path[src]

impl PartialEq<[u8; 10]> for Path[src]

impl PartialEq<[u8; 11]> for Path[src]

impl PartialEq<[u8; 12]> for Path[src]

impl PartialEq<[u8; 13]> for Path[src]

impl PartialEq<[u8; 14]> for Path[src]

impl PartialEq<[u8; 15]> for Path[src]

impl PartialEq<[u8; 16]> for Path[src]

impl PartialEq<[u8; 17]> for Path[src]

impl PartialEq<[u8; 18]> for Path[src]

impl PartialEq<[u8; 19]> for Path[src]

impl PartialEq<[u8; 2]> for Path[src]

impl PartialEq<[u8; 20]> for Path[src]

impl PartialEq<[u8; 21]> for Path[src]

impl PartialEq<[u8; 22]> for Path[src]

impl PartialEq<[u8; 23]> for Path[src]

impl PartialEq<[u8; 24]> for Path[src]

impl PartialEq<[u8; 25]> for Path[src]

impl PartialEq<[u8; 26]> for Path[src]

impl PartialEq<[u8; 27]> for Path[src]

impl PartialEq<[u8; 28]> for Path[src]

impl PartialEq<[u8; 29]> for Path[src]

impl PartialEq<[u8; 3]> for Path[src]

impl PartialEq<[u8; 30]> for Path[src]

impl PartialEq<[u8; 31]> for Path[src]

impl PartialEq<[u8; 32]> for Path[src]

impl PartialEq<[u8; 4]> for Path[src]

impl PartialEq<[u8; 5]> for Path[src]

impl PartialEq<[u8; 6]> for Path[src]

impl PartialEq<[u8; 7]> for Path[src]

impl PartialEq<[u8; 8]> for Path[src]

impl PartialEq<[u8; 9]> for Path[src]

impl PartialEq<str> for Path[src]

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

type Error = Error

The type returned in the event of a conversion error.

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]