Skip to main content

DataKind

Struct DataKind 

Source
pub struct DataKind(/* private fields */);
Expand description

Type of filesystem object represented by an entry.

Each value determines how the entry’s data should be interpreted and how the entry should be extracted to the filesystem. Values without an associated constant are either reserved for future PNA specification (raw value < 128) or application-specific private values (raw value >= 128).

Implementations§

Source§

impl DataKind

Source

pub const FILE: Self

Regular file. Entry data contains the file contents.

Source

pub const DIRECTORY: Self

Directory. Entry has no data content.

Symbolic link. Entry data contains the UTF-8 encoded link target path.

Hard link. Entry data contains the UTF-8 encoded path of the target entry within the same archive.

Source

pub const File: Self = Self::FILE

👎Deprecated since 0.36.0:

renamed to DataKind::FILE

Deprecated alias of DataKind::FILE.

Source

pub const Directory: Self = Self::DIRECTORY

👎Deprecated since 0.36.0:

renamed to DataKind::DIRECTORY

Deprecated alias of DataKind::DIRECTORY.

👎Deprecated since 0.36.0:

renamed to DataKind::SYMBOLIC_LINK

Deprecated alias of DataKind::SYMBOLIC_LINK.

👎Deprecated since 0.36.0:

renamed to DataKind::HARD_LINK

Deprecated alias of DataKind::HARD_LINK.

Source

pub const fn from_byte(value: u8) -> Self

Deserializes a data kind from its u8 representation.

Every byte value is a valid data kind, so this conversion never fails.

Source

pub const fn to_byte(self) -> u8

Serializes this data kind to its u8 representation.

Source

pub const fn new_private(value: u8) -> Option<Self>

Creates an application-specific private value.

Returns Some if value is in the private range (128..=255), otherwise None.

Source

pub const fn try_from(value: u8) -> Result<Self, UnknownValueError>

👎Deprecated since 0.36.0:

use DataKind::from_byte

Converts a u8 into a DataKind. Never fails.

Shadows <DataKind as TryFrom<u8>>::try_from so existing DataKind::try_from(..) call sites receive a deprecation warning; both will be removed together in a future release.

§Errors

Never returns Err; every byte value is a valid data kind.

Source

pub const fn is_reserved(self) -> bool

Returns true if this value is reserved for future PNA specification (unassigned and raw value < 128).

Source

pub const fn is_private(self) -> bool

Returns true if this is an application-specific private value (raw value >= 128).

Trait Implementations§

Source§

impl Clone for DataKind

Source§

fn clone(&self) -> DataKind

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 DataKind

Source§

impl Debug for DataKind

Source§

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

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

impl Eq for DataKind

Source§

impl Hash for DataKind

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for DataKind

Source§

fn cmp(&self, other: &DataKind) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for DataKind

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for DataKind

Source§

fn partial_cmp(&self, other: &DataKind) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl StructuralPartialEq for DataKind

Source§

impl TryFrom<u8> for DataKind

Infallible; kept for backward compatibility with the former enum-based API and scheduled for removal in a future release. Use DataKind::from_byte instead.

Source§

type Error = UnknownValueError

The type returned in the event of a conversion error.
Source§

fn try_from(value: u8) -> Result<Self, Self::Error>

Performs the conversion.

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V