Skip to main content

HonzoParser

Struct HonzoParser 

Source
pub struct HonzoParser<'buf> { /* private fields */ }

Implementations§

Source§

impl<'buf> HonzoParser<'buf>

Source

pub fn new(buf: &'buf [u8], reader_version: u16) -> Result<Self, HonzoError>

Source

pub fn head(&self) -> &HonzoHead

Source

pub fn toc_entries(&self) -> TocEntryIter<'buf>

Source

pub fn pmap_entries(&self) -> PmapEntryIter<'buf>

Source

pub fn chunk_bytes( &self, entry: &TocEntry<'_>, ) -> Result<&'buf [u8], HonzoError>

Source

pub fn chunk_bytes_unchecked( &self, entry: &TocEntry<'_>, ) -> Result<&'buf [u8], HonzoError>

Read raw chunk bytes regardless of the encrypted flag. Upper layers (honzo-io) handle decryption when a key is provided.

Source

pub fn meta_bytes(&self) -> Result<&'buf [u8], HonzoError>

Source

pub fn extra_bytes(&self) -> Result<&'buf [u8], HonzoError>

Source

pub fn find_chunk(&self, tag: &[u8; 4]) -> Option<TocEntry<'buf>>

Source

pub fn find_chunk_by_id(&self, id: u32) -> Option<TocEntry<'buf>>

Trait Implementations§

Source§

impl<'buf> Debug for HonzoParser<'buf>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'buf> Freeze for HonzoParser<'buf>

§

impl<'buf> RefUnwindSafe for HonzoParser<'buf>

§

impl<'buf> Send for HonzoParser<'buf>

§

impl<'buf> Sync for HonzoParser<'buf>

§

impl<'buf> Unpin for HonzoParser<'buf>

§

impl<'buf> UnsafeUnpin for HonzoParser<'buf>

§

impl<'buf> UnwindSafe for HonzoParser<'buf>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.