Struct goblin::archive::MemberHeader

source ·
#[repr(C)]
pub struct MemberHeader { pub identifier: [u8; 16], pub timestamp: [u8; 12], pub owner_id: [u8; 6], pub group_id: [u8; 6], pub mode: [u8; 8], pub file_size: [u8; 10], pub terminator: [u8; 2], }
Expand description

A Unix Archive Header - meta data for the file/byte blob/whatever that follows exactly after. All data is right-padded with spaces ASCII 0x20. The Binary layout is as follows:

OffsetLengthNameFormat
016File identifierASCII
1612File modification timestampDecimal
286Owner IDDecimal
346Group IDDecimal
408File modeOctal
4810Filesize in bytesDecimal
582Ending characters0x60 0x0A

Byte alignment is according to the following:

Each archive file member begins on an even byte boundary; a newline is inserted between files if necessary. Nevertheless, the size given reflects the actual size of the file exclusive of padding.

Fields§

§identifier: [u8; 16]

The identifier, or name for this file/whatever.

§timestamp: [u8; 12]

The timestamp for when this file was last modified. Base 10 number

§owner_id: [u8; 6]

The file’s owner’s id. Base 10 string number

§group_id: [u8; 6]

The file’s group id. Base 10 string number

§mode: [u8; 8]

The file’s permissions mode. Base 8 number number

§file_size: [u8; 10]

The size of this file. Base 10 string number

§terminator: [u8; 2]

The file header’s terminator, always 0x60 0x0A

Implementations§

source§

impl MemberHeader

source

pub fn name(&self) -> Result<&str>

source

pub fn size(&self) -> Result<usize>

Trait Implementations§

source§

impl Clone for MemberHeader

source§

fn clone(&self) -> MemberHeader

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 MemberHeader

source§

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

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

impl PartialEq for MemberHeader

source§

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

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl SizeWith<Endian> for MemberHeader

source§

impl<'a> TryFromCtx<'a, Endian> for MemberHeader
where MemberHeader: 'a,

§

type Error = Error

source§

fn try_from_ctx( src: &'a [u8], ctx: Endian ) -> Result<(Self, usize), Self::Error>

source§

impl<'a> TryIntoCtx<Endian> for &'a MemberHeader

§

type Error = Error

source§

fn try_into_ctx(self, dst: &mut [u8], ctx: Endian) -> Result<usize, Self::Error>

source§

impl TryIntoCtx<Endian> for MemberHeader

§

type Error = Error

source§

fn try_into_ctx(self, dst: &mut [u8], ctx: Endian) -> Result<usize, Self::Error>

source§

impl StructuralPartialEq for MemberHeader

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