Skip to main content

Metadata

Struct Metadata 

Source
pub struct Metadata { /* private fields */ }
Expand description

Metadata information for an archive entry.

Implementations§

Source§

impl Metadata

Source

pub fn from_fields( size: i64, nodetype: u32, perm: c_uint, mtime: i64, mtime_nano: i64, ) -> Self

Create metadata for in-memory entries without filesystem dependency.

Source

pub fn filepath(&self) -> &str

Returns the filepath of the entry.

Source

pub fn size(&self) -> i64

Returns the size of the entry in bytes.

Source

pub fn nodetype(&self) -> u32

Returns the node type (file, directory, etc.)

Source

pub fn perm(&self) -> c_uint

Returns the permissions mode.

Source

pub fn ctime(&self) -> i64

Returns the creation time in seconds.

Source

pub fn ctime_nano(&self) -> i64

Returns the creation time nanoseconds part.

Source

pub fn atime(&self) -> i64

Returns the last access time in seconds.

Source

pub fn atime_nano(&self) -> i64

Returns the last access time nanoseconds part.

Source

pub fn mtime(&self) -> i64

Returns the last modification time in seconds.

Source

pub fn mtime_nano(&self) -> i64

Returns the last modification time nanoseconds part.

Source

pub fn owner(&self) -> uid_t

Returns the owner UID.

Source

pub fn group(&self) -> gid_t

Returns the group GID.

Source

pub fn is_dir(&self) -> bool

Returns true if the entry is a directory.

Source

pub fn is_file(&self) -> bool

Returns true if the entry is a regular file.

Returns true if the entry is a symbolic link.

Source

pub fn is_block_device(&self) -> bool

Returns true if the entry is a block device.

Source

pub fn is_char_device(&self) -> bool

Returns true if the entry is a character device.

Source

pub fn is_fifo(&self) -> bool

Returns true if the entry is a FIFO (named pipe).

Source

pub fn is_socket(&self) -> bool

Returns true if the entry is a socket.

Trait Implementations§

Source§

impl Clone for Metadata

Source§

fn clone(&self) -> Metadata

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 From<*mut archive_entry> for Metadata

Source§

fn from(input: *mut archive_entry) -> Self

Converts to this type from the input type.
Source§

impl From<Metadata> for Metadata

Source§

fn from(meta: FSMeta) -> Self

Converts to this type from the input type.

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> 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> 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 = 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.