Struct goblin::archive::MemberHeader [−][src]
#[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], }
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:
Offset | Length | Name | Format |
---|---|---|---|
0 | 16 | File identifier | ASCII |
16 | 12 | File modification timestamp | Decimal |
28 | 6 | Owner ID | Decimal |
34 | 6 | Group ID | Decimal |
40 | 8 | File mode | Octal |
48 | 10 | Filesize in bytes | Decimal |
58 | 2 | Ending characters | 0x60 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
Methods
impl MemberHeader
[src]
impl MemberHeader
Trait Implementations
impl Debug for MemberHeader
[src]
impl Debug for MemberHeader
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for MemberHeader
[src]
impl Clone for MemberHeader
fn clone(&self) -> MemberHeader
[src]
fn clone(&self) -> MemberHeader
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for MemberHeader
[src]
impl PartialEq for MemberHeader
fn eq(&self, other: &MemberHeader) -> bool
[src]
fn eq(&self, other: &MemberHeader) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MemberHeader) -> bool
[src]
fn ne(&self, other: &MemberHeader) -> bool
This method tests for !=
.
impl<'a> TryFromCtx<'a, Endian> for MemberHeader where
MemberHeader: 'a,
[src]
impl<'a> TryFromCtx<'a, Endian> for MemberHeader where
MemberHeader: 'a,
type Error = Error
type Size = usize
fn try_from_ctx(
src: &'a [u8],
ctx: Endian
) -> Result<(Self, Self::Size), Self::Error>
[src]
fn try_from_ctx(
src: &'a [u8],
ctx: Endian
) -> Result<(Self, Self::Size), Self::Error>
impl<'a> TryIntoCtx<Endian> for &'a MemberHeader
[src]
impl<'a> TryIntoCtx<Endian> for &'a MemberHeader
type Error = Error
type Size = usize
fn try_into_ctx(
self,
dst: &mut [u8],
ctx: Endian
) -> Result<Self::Size, Self::Error>
[src]
fn try_into_ctx(
self,
dst: &mut [u8],
ctx: Endian
) -> Result<Self::Size, Self::Error>
impl TryIntoCtx<Endian> for MemberHeader
[src]
impl TryIntoCtx<Endian> for MemberHeader
type Error = Error
type Size = usize
fn try_into_ctx(
self,
dst: &mut [u8],
ctx: Endian
) -> Result<Self::Size, Self::Error>
[src]
fn try_into_ctx(
self,
dst: &mut [u8],
ctx: Endian
) -> Result<Self::Size, Self::Error>
impl SizeWith<Endian> for MemberHeader
[src]
impl SizeWith<Endian> for MemberHeader
Auto Trait Implementations
impl Send for MemberHeader
impl Send for MemberHeader
impl Sync for MemberHeader
impl Sync for MemberHeader