pub struct DirMeta {
pub uid: u32,
pub gid: u32,
pub mode: u32,
pub xattrs: Xattrs,
}Expand description
An owned dirmeta object: the owner, the mode, and the xattrs of a directory.
The scalar fields are in host byte order.
§Wire form
The GVariant type is (uuua(ayay)). The members are:
- the uid
- the gid
- the full
st_mode, with the directory type bits - the xattrs, sorted by name, in the storage form of
Xattrs
The three u values are big-endian. The mode must be a directory mode, so
this type holds only .dirmeta objects. The same layout is the
user.ostreemeta xattr of a bare-user file object.
FileHeader::parse_stat_metadata
reads that xattr.
Fields§
§uid: u32The owner uid.
gid: u32The owner gid.
mode: u32The full st_mode, with the directory type bits.
xattrs: XattrsThe extended attributes of the directory.
Implementations§
Source§impl DirMeta
impl DirMeta
Sourcepub fn parse(data: &[u8]) -> Result<DirMeta>
pub fn parse(data: &[u8]) -> Result<DirMeta>
Parses a serialized dirmeta object.
§Errors
Error::Gvariantifdatais not a normal-form(uuua(ayay))tuple, or if an xattr entry is not a normal-form(ayay)pair.Error::InvalidDirMetawith the reasonmode is not a directory modeif the type bits of the mode are not the directory type.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§
impl Eq for DirMeta
Source§impl GvEncode for DirMeta
The (uuua(ayay)) encoding, with no check of the mode.
impl GvEncode for DirMeta
The (uuua(ayay)) encoding, with no check of the mode.
DirMeta::serialize checks that the mode is a directory mode.
impl StructuralPartialEq for DirMeta
Auto Trait Implementations§
impl Forget for DirMeta
impl Freeze for DirMeta
impl Move for DirMeta
impl RefUnwindSafe for DirMeta
impl Send for DirMetawhere
RawVecInner: Send,
impl Sync for DirMetawhere
RawVecInner: Sync,
impl Unpin for DirMeta
impl UnsafeUnpin for DirMeta
impl UnwindSafe for DirMetawhere
RawVecInner: 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