Enum EntryType

pub enum EntryType

Indicate the type of content described by a header.

This is returned by [crate::Header::entry_type()] and should be used to distinguish between types of content.

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

impl EntryType

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.

fn as_byte(&self) -> u8

Returns the raw underlying byte that this entry type represents.

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.

fn character_special() -> EntryType

Creates a new entry type representing a character special device.

fn block_special() -> EntryType

Creates a new entry type representing a block special device.

fn dir() -> EntryType

Creates a new entry type representing a directory.

fn fifo() -> EntryType

Creates a new entry type representing a FIFO.

fn contiguous() -> EntryType

Creates a new entry type representing a contiguous file.

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.

fn is_character_special(&self) -> bool

Returns whether this type represents a character special device.

fn is_block_special(&self) -> bool

Returns whether this type represents a block special device.

fn is_dir(&self) -> bool

Returns whether this type represents a directory.

fn is_fifo(&self) -> bool

Returns whether this type represents a FIFO.

fn is_contiguous(&self) -> bool

Returns whether this type represents a contiguous file.

fn is_gnu_longname(&self) -> bool

Returns whether this type represents a GNU long name header.

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.

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.

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

impl Clone for EntryType

fn clone(&self) -> EntryType

impl Copy for EntryType

impl Debug for EntryType

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

impl Eq for EntryType

impl PartialEq for EntryType

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

impl StructuralPartialEq for EntryType

Auto Trait Implementations

impl Freeze for EntryType

impl RefUnwindSafe for EntryType

impl Send for EntryType

impl Sync for EntryType

impl Unpin for EntryType

impl UnsafeUnpin for EntryType

impl UnwindSafe for EntryType

Blanket Implementations

impl<T> Any for EntryType where T: 'static + ?Sized,

fn type_id(&self) -> TypeId

impl<T> Borrow<T> for EntryType where T: ?Sized,

fn borrow(&self) -> &T

impl<T> BorrowMut<T> for EntryType where T: ?Sized,

fn borrow_mut(&mut self) -> &mut T

impl<T> CloneToUninit for EntryType where T: Clone,

unsafe fn clone_to_uninit(&self, dest: *mut u8)

impl<T> From<T> for EntryType

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for EntryType where T: Clone,

type Owned = T;
fn to_owned(&self) -> T
fn clone_into(&self, target: &mut T)

impl<T, U> Into<U> for EntryType where U: From<T>,

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom<U> for EntryType where U: Into<T>,

type Error = never;
fn try_from(value: U) -> Result<T, never>

impl<T, U> TryInto<U> for EntryType where U: TryFrom<T>,

type Error = <U as TryFrom<T>>::Error;
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>