Skip to main content

EntryType

Enum EntryType 

Source
pub enum EntryType {
Show 13 variants Regular, Link, Symlink, Char, Block, Directory, Fifo, Continuous, GNULongName, GNULongLink, GNUSparse, XGlobalHeader, XHeader, // some variants omitted
}
Expand description

Indicate for the type of file described by a header.

Each Header has an entry_type method returning an instance of this type which can be used to inspect what the header is describing. A non-exhaustive enum representing the possible entry types

Variants§

§

Regular

Regular file

Hard link

Symbolic link

§

Char

Character device

§

Block

Block device

§

Directory

Directory

§

Fifo

Named pipe (fifo)

§

Continuous

Implementation-defined ‘high-performance’ type, treated as regular file

§

GNULongName

GNU extension - long file name

GNU extension - long link name (link target)

§

GNUSparse

GNU extension - sparse file

§

XGlobalHeader

Global extended header

§

XHeader

Extended Header

Implementations§

Source§

impl EntryType

Source

pub fn new(byte: u8) -> EntryType

Creates a new entry type from a raw byte.

Note that the other named constructors of entry type may be more appropriate to create a file type from.

Source

pub fn as_byte(&self) -> u8

Returns the raw underlying byte that this entry type represents.

Source

pub fn file() -> EntryType

Creates a new entry type representing a regular file.

Creates a new entry type representing a hard link.

Creates a new entry type representing a symlink.

Source

pub fn character_special() -> EntryType

Creates a new entry type representing a character special device.

Source

pub fn block_special() -> EntryType

Creates a new entry type representing a block special device.

Source

pub fn dir() -> EntryType

Creates a new entry type representing a directory.

Source

pub fn fifo() -> EntryType

Creates a new entry type representing a FIFO.

Source

pub fn contiguous() -> EntryType

Creates a new entry type representing a contiguous file.

Source

pub fn is_file(&self) -> bool

Returns whether this type represents a regular file.

Returns whether this type represents a hard link.

Returns whether this type represents a symlink.

Source

pub fn is_character_special(&self) -> bool

Returns whether this type represents a character special device.

Source

pub fn is_block_special(&self) -> bool

Returns whether this type represents a block special device.

Source

pub fn is_dir(&self) -> bool

Returns whether this type represents a directory.

Source

pub fn is_fifo(&self) -> bool

Returns whether this type represents a FIFO.

Source

pub fn is_contiguous(&self) -> bool

Returns whether this type represents a contiguous file.

Source

pub fn is_gnu_longname(&self) -> bool

Returns whether this type represents a GNU long name header.

Source

pub fn is_gnu_sparse(&self) -> bool

Returns whether this type represents a GNU sparse header.

Returns whether this type represents a GNU long link header.

Source

pub fn is_pax_global_extensions(&self) -> bool

Returns whether this type represents PAX global extensions, that should affect all following entries. For more, see PAX.

Source

pub fn is_pax_local_extensions(&self) -> bool

Returns whether this type represents PAX local extensions; these only affect the current entry. For more, see PAX.

Trait Implementations§

Source§

impl Clone for EntryType

Source§

fn clone(&self) -> EntryType

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 Copy for EntryType

Source§

impl Debug for EntryType

Source§

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

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

impl Eq for EntryType

Source§

impl PartialEq for EntryType

Source§

fn eq(&self, other: &EntryType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for EntryType

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.