[][src]Struct rscache::sec::SectorHeader

pub struct SectorHeader {
    pub archive_id: u32,
    pub chunk: u16,
    pub next: u32,
    pub index_id: u8,
}

Contains the sector header for reading the next sector and validating the current sector.

Fields

archive_id: u32chunk: u16next: u32index_id: u8

Implementations

impl SectorHeader[src]

pub fn new(buffer: &[u8], expanded_header: bool) -> Result<(&[u8], Self)>[src]

Decodes only the header data from the buffer leaving the data block untouched.

The expanded header should be 10 bytes instead of the usual 8 bytes.

pub fn validate(
    &self,
    archive_id: u32,
    chunk: u16,
    index_id: u8
) -> Result<(), ReadError>
[src]

Validates the current archive_id, chunk and index_id against the expected values from this header struct.

Trait Implementations

impl Clone for SectorHeader[src]

impl Debug for SectorHeader[src]

impl Default for SectorHeader[src]

impl Eq for SectorHeader[src]

impl Hash for SectorHeader[src]

impl Ord for SectorHeader[src]

impl PartialEq<SectorHeader> for SectorHeader[src]

impl PartialOrd<SectorHeader> for SectorHeader[src]

impl StructuralEq for SectorHeader[src]

impl StructuralPartialEq for SectorHeader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.