Struct GnuExtSparseHeader

#[repr(C)]
pub struct GnuExtSparseHeader { pub sparse: [GnuSparseHeader; 21], pub isextended: [u8; 1], pub padding: [u8; 7] }

Representation of the entry found to represent extended GNU sparse files.

When a GnuHeader has the isextended flag set to 1 then the contents of the next entry will be one of these headers.

Fields

sparse: [GnuSparseHeader; 21]
isextended: [u8; 1]
padding: [u8; 7]

Implementations

impl GnuExtSparseHeader

fn new() -> GnuExtSparseHeader

Crates a new zero'd out sparse header entry.

fn as_bytes(&self) -> &[u8; 512]

Returns a view into this header as a byte array.

fn as_mut_bytes(&mut self) -> &mut [u8; 512]

Returns a view into this header as a byte array.

fn sparse(&self) -> &[GnuSparseHeader; 21]

Returns a slice of the underlying sparse headers.

Some headers may represent empty chunks of both the offset and numbytes fields are 0.

fn sparse_mut(&mut self) -> &mut [GnuSparseHeader; 21]

Same as sparse but mutable version.

fn is_extended(&self) -> bool

Indicates if another sparse header should be following this one.

fn set_is_extended(&mut self, is_extended: bool)

Sets whether another sparse header should be following this one.

Trait Implementations

impl Default for GnuExtSparseHeader

fn default() -> Self

Auto Trait Implementations

impl Freeze for GnuExtSparseHeader

impl RefUnwindSafe for GnuExtSparseHeader

impl Send for GnuExtSparseHeader

impl Sync for GnuExtSparseHeader

impl Unpin for GnuExtSparseHeader

impl UnsafeUnpin for GnuExtSparseHeader

impl UnwindSafe for GnuExtSparseHeader

Blanket Implementations

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

fn type_id(&self) -> TypeId

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

fn borrow(&self) -> &T

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

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

impl<T> From<T> for GnuExtSparseHeader

fn from(t: T) -> T

Returns the argument unchanged.

impl<T, U> Into<U> for GnuExtSparseHeader 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 GnuExtSparseHeader where U: Into<T>,

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

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

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