Enum tar::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 a GNU long name header.

source

pub fn is_pax_local_extensions(&self) -> bool

Returns whether this type represents a GNU long link header.

Trait Implementations§

source§

impl Clone for EntryType

source§

fn clone(&self) -> EntryType

Returns a copy of the value. Read more
1.0.0 · source§

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

Performs copy-assignment from source. Read more
source§

impl Debug for EntryType

source§

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

Formats the value using the given formatter. Read more
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 · 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 Copy for EntryType

source§

impl Eq for EntryType

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§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

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

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

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

§

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>,

§

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>,

§

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.