Skip to main content

OleanReader

Struct OleanReader 

Source
pub struct OleanReader<'a> { /* private fields */ }
Expand description

Streaming binary reader for the OleanC format.

Implementations§

Source§

impl<'a> OleanReader<'a>

Source

pub fn new(data: &'a [u8]) -> Self

Create a new reader over the given byte slice.

Source

pub fn remaining(&self) -> usize

Number of bytes remaining to be read.

Source

pub fn read_header(&mut self) -> Result<OleanHeader, OleanError>

Read and validate the OleanC file header.

Source

pub fn read_string(&mut self) -> Result<String, OleanError>

Read a length-prefixed UTF-8 string.

Source

pub fn read_u8(&mut self) -> Result<u8, OleanError>

Read a single byte.

Source

pub fn read_u32(&mut self) -> Result<u32, OleanError>

Read a u32 in little-endian order.

Source

pub fn read_u64(&mut self) -> Result<u64, OleanError>

Read a u64 in little-endian order.

Source

pub fn read_i64(&mut self) -> Result<i64, OleanError>

Read an i64 in little-endian order.

Source

pub fn read_bool(&mut self) -> Result<bool, OleanError>

Read a bool from a single byte.

Auto Trait Implementations§

§

impl<'a> Freeze for OleanReader<'a>

§

impl<'a> RefUnwindSafe for OleanReader<'a>

§

impl<'a> Send for OleanReader<'a>

§

impl<'a> Sync for OleanReader<'a>

§

impl<'a> Unpin for OleanReader<'a>

§

impl<'a> UnsafeUnpin for OleanReader<'a>

§

impl<'a> UnwindSafe for OleanReader<'a>

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.