pub struct DirMetaRef<'a> { /* private fields */ }Expand description
A borrowed view of a serialized dirmeta object.
parse decodes the scalar fields and checks the mode.
The xattrs stay serialized until a caller reads them.
Implementations§
Source§impl<'a> DirMetaRef<'a>
impl<'a> DirMetaRef<'a>
Sourcepub fn parse(data: &'a [u8]) -> Result<DirMetaRef<'a>>
pub fn parse(data: &'a [u8]) -> Result<DirMetaRef<'a>>
Parses a slice that holds exactly one serialized dirmeta object.
The function does not check the xattr names.
to_owned and the iterator of
xattrs check them.
§Errors
Error::Gvariantifdatais not a normal-form(uuua(ayay))tuple, or if the framing of the xattr array is not normal form.Error::InvalidDirMetawith the reasonmode is not a directory modeif the type bits of the mode are not the directory type.
Sourcepub fn xattrs(&self) -> XattrsRef<'a>
pub fn xattrs(&self) -> XattrsRef<'a>
Returns a borrowed view of the extended attributes of the directory.
Sourcepub fn to_owned(&self) -> Result<DirMeta>
pub fn to_owned(&self) -> Result<DirMeta>
Collects the view into an owned DirMeta.
§Errors
Error::Gvariantif an xattr entry is not a normal-form(ayay)pair.Error::InvalidXattrsif an xattr name is not in the stored form, or if the names are not strictly sorted.Xattrs::from_gvariantlists the reasons.
Trait Implementations§
Source§impl<'a> Clone for DirMetaRef<'a>
impl<'a> Clone for DirMetaRef<'a>
impl<'a> Copy for DirMetaRef<'a>
Auto Trait Implementations§
impl<'a> Forget for DirMetaRef<'a>
impl<'a> Freeze for DirMetaRef<'a>
impl<'a> Move for DirMetaRef<'a>
impl<'a> RefUnwindSafe for DirMetaRef<'a>
impl<'a> Send for DirMetaRef<'a>
impl<'a> Sync for DirMetaRef<'a>
impl<'a> Unpin for DirMetaRef<'a>
impl<'a> UnsafeUnpin for DirMetaRef<'a>
impl<'a> UnwindSafe for DirMetaRef<'a>where
&'a [u8]: UnwindSafe,
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