Struct Source

Source
pub struct Source {
    pub data: SourceData,
    pub uid: u32,
    pub gid: u32,
    pub mode: u16,
    pub modified: u32,
    pub xattrs: HashMap<OsString, Vec<u8>>,
    pub flags: u32,
}
Expand description

A single node to be added to the SquashFS archive.

This contains a SourceData instance containing the actual data of the node, along with metadata such as permissions and extended attributes. The path to the node is not part of this object, because all information necessary to reconstruct the directory tree is contained in the directory iterators. However, for higher-level mechanisms that abstract away details such as inode numbers, it is helpful to associate a path with each Source; SourceFile is used for this purpose.

This object is designed to be constructed by the user by setting all fields to the appropriate values.

Fields§

§data: SourceData

The type of the node and the data it contains.

§uid: u32

The UID of the file.

§gid: u32

The GID of the file.

§mode: u16

The file mode.

§modified: u32

The modification time of the file as a Unix timestamp.

§xattrs: HashMap<OsString, Vec<u8>>

Extended attributes on the node. Each one must start with a valid xattr namespace (such as “user.”, and the values can be arbitrary byte strings.

§flags: u32

BlockFlags to set on the node to control how its contents are archived. Multiple flags can be combined using |.

Implementations§

Source§

impl Source

Source

pub fn defaults(data: SourceData) -> Self

Construct a Source from a SourceData, using defaults for all metadata fields.

Auto Trait Implementations§

§

impl Freeze for Source

§

impl !RefUnwindSafe for Source

§

impl Send for Source

§

impl Sync for Source

§

impl Unpin for Source

§

impl !UnwindSafe for Source

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<T> Erased for T