Struct GnuSparseHeader
#[repr(C)]
pub struct GnuSparseHeader { pub offset: [u8; 12], pub numbytes: [u8; 12] }
Description of the header of a sparse entry.
Specifies the offset/number of bytes of a chunk of data in octal.
Fields
offset: [u8; 12]numbytes: [u8; 12]
Implementations
impl GnuSparseHeader
fn is_empty(&self) -> boolReturns true if block is empty
fn offset(&self) -> Result<u64>Offset of the block from the start of the file
Returns
Errfor a malformedoffsetfield.fn set_offset(&mut self, offset: u64)Encodes the
offsetprovided into this header.fn length(&self) -> Result<u64>Length of the block
Returns
Errfor a malformednumbytesfield.fn set_length(&mut self, length: u64)Encodes the
lengthprovided into this header.
Trait Implementations
impl Debug for GnuSparseHeader
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl Freeze for GnuSparseHeader
impl RefUnwindSafe for GnuSparseHeader
impl Send for GnuSparseHeader
impl Sync for GnuSparseHeader
impl Unpin for GnuSparseHeader
impl UnsafeUnpin for GnuSparseHeader
impl UnwindSafe for GnuSparseHeader
Blanket Implementations
impl<T> Any for GnuSparseHeader
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for GnuSparseHeader
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for GnuSparseHeader
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for GnuSparseHeader
fn from(t: T) -> TReturns the argument unchanged.
impl<T, U> Into<U> for GnuSparseHeader
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for GnuSparseHeader
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for GnuSparseHeader
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>