[−][src]Struct rscache::sec::SectorHeader
Contains the sector header for reading the next sector and validating the current sector.
Fields
archive_id: u32
chunk: u16
next: u32
index_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]
&self,
archive_id: u32,
chunk: u16,
index_id: u8
) -> Result<(), ReadError>
Validates the current archive_id
, chunk
and index_id
against the expected
values from this header struct.
Trait Implementations
impl Clone for SectorHeader
[src]
fn clone(&self) -> SectorHeader
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for SectorHeader
[src]
impl Default for SectorHeader
[src]
fn default() -> SectorHeader
[src]
impl Eq for SectorHeader
[src]
impl Hash for SectorHeader
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for SectorHeader
[src]
fn cmp(&self, other: &SectorHeader) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<SectorHeader> for SectorHeader
[src]
fn eq(&self, other: &SectorHeader) -> bool
[src]
fn ne(&self, other: &SectorHeader) -> bool
[src]
impl PartialOrd<SectorHeader> for SectorHeader
[src]
fn partial_cmp(&self, other: &SectorHeader) -> Option<Ordering>
[src]
fn lt(&self, other: &SectorHeader) -> bool
[src]
fn le(&self, other: &SectorHeader) -> bool
[src]
fn gt(&self, other: &SectorHeader) -> bool
[src]
fn ge(&self, other: &SectorHeader) -> bool
[src]
impl StructuralEq for SectorHeader
[src]
impl StructuralPartialEq for SectorHeader
[src]
Auto Trait Implementations
impl RefUnwindSafe for SectorHeader
impl Send for SectorHeader
impl Sync for SectorHeader
impl Unpin for SectorHeader
impl UnwindSafe for SectorHeader
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,