Enum SourceData

Source
pub enum SourceData {
    File(Box<dyn Read + Sync + Send>),
    Dir(Box<dyn Iterator<Item = (OsString, u32)> + Sync + Send>),
    Symlink(PathBuf),
    BlockDev(u32, u32),
    CharDev(u32, u32),
    Fifo,
    Socket,
}
Expand description

Represents the data of a filesystem object that can be added to an archive.

When creating the archive, this object is read from a Source (which additionally describes the filesystem attributes of the node) and used to set the type and contents of the node.

Variants§

§

File(Box<dyn Read + Sync + Send>)

Create a file with the provided contents.

The contained object will be read and its contents placed in the file written to the archive.

§

Dir(Box<dyn Iterator<Item = (OsString, u32)> + Sync + Send>)

Create a directory with the given chidren.

The creator must provide an iterator over OsString and u32, which respectively represent the name and inode number of each child of this directory. This is one of the hardest parts about writing archive contents – all children of each directory must be written before the directory itself, so that the inode numbers of the children are known. TreeProcessor facilitates this by performing a post-order traversal of a filesystem, ensuring that files are written in the correct order.

Create a symbolic link to the given path.

It is not required for the target of the symlink to exist.

§

BlockDev(u32, u32)

Create a block device file with the given major and minor device numbers.

§

CharDev(u32, u32)

Create a character device file with the given major and minor device numbers.

§

Fifo

Create a named pipe.

§

Socket

Create a socket.

Auto Trait Implementations§

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