Skip to main content

Metadata

Struct Metadata 

Source
pub struct Metadata {
    pub mode: u32,
    pub uid: u32,
    pub gid: u32,
    pub mtime: (u64, u32),
    pub xattrs: Vec<(Vec<u8>, Vec<u8>)>,
}
Expand description

The logical metadata of a node.

Fields§

§mode: u32

The full st_mode of the node.

The writer ignores the file-type bits and takes the type from the Node variant. It keeps the bits of mode & 0o7777: the permission bits and the setuid, setgid, and sticky bits.

§uid: u32

The user id of the owner.

§gid: u32

The group id of the owner.

§mtime: (u64, u32)

The modification time as (seconds, nanoseconds).

§xattrs: Vec<(Vec<u8>, Vec<u8>)>

The extended attributes as (name, value) pairs.

The caller gives the logical names and values. The writer makes their EROFS encoding (prefix indexing, ordering, sharing, and the name filter). It escapes each trusted.overlay.X name as trusted.overlay.overlay.X. The escape adds 8 bytes to the name suffix.

§Limits

Each limit is the range of an EROFS length or count field:

  • A value is at most 65535 bytes.
  • A name suffix is at most 255 bytes. The suffix is the part of the name after its EROFS prefix, and the limit applies after the escape.
  • The xattr area of one inode is at most 262148 bytes. The number of attributes has no limit of its own.

If a name, a value, or an area is larger than its limit, the writer panics. The field in the image cannot state a larger size.

The writer shares an entry that repeats across inodes. One inode references at most 128 shared entries, the limit that an observation of the ostree command shows. If an inode has more repeated entries, it references the first 128 in name order and keeps the others inline.

Trait Implementations§

Source§

impl Clone for Metadata

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Metadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Metadata

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for Metadata

§

impl Freeze for Metadata
where *const u8 is !null: Freeze, PhantomData<(Vec<u8>, Vec<u8>)>: Freeze,

§

impl Move for Metadata

§

impl RefUnwindSafe for Metadata

§

impl Send for Metadata
where RawVecInner: Send,

§

impl Sync for Metadata
where RawVecInner: Sync,

§

impl Unpin for Metadata
where *const u8 is !null: Unpin,

§

impl UnsafeUnpin for Metadata

§

impl UnwindSafe for Metadata
where RawVecInner: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.