Struct littlefs2::path::Path [−][src]
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]
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.
fn try_from(bytes: &[u8; 1]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 10]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 10]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 11]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 11]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 12]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 12]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 13]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 13]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 14]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 14]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 15]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 15]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 16]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 16]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 17]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 17]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 18]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 18]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 19]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 19]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 2]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 2]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 20]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 20]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 21]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 21]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 22]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 22]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 23]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 23]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 24]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 24]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 25]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 25]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 26]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 26]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 27]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 27]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 28]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 28]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 29]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 29]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 3]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 3]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 30]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 30]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 31]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 31]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 32]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 32]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 4]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 4]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 5]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 5]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 6]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 6]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 7]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 7]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 8]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.
fn try_from(bytes: &[u8; 8]) -> Result<&Path>
[src]
impl<'b> TryFrom<&'b [u8; 9]> for &'b Path
[src]
type Error = Error
The type returned in the event of a conversion error.