Skip to main content

RawStream

Struct RawStream 

Source
pub struct RawStream<'a> {
    pub meta: StreamMeta,
    pub data: RawStreamData<'a>,
}
Expand description

Representation of an encoded stream

Fields§

§meta: StreamMeta§data: RawStreamData<'a>

Implementations§

Source§

impl RawStream<'_>

Source

pub fn decode_bools(self, dec: &mut Decoder) -> Result<Vec<bool>, MltError>

Decode a boolean stream: byte-RLE → packed bitmap → Vec<bool>, charging dec.

Source

pub fn decode_i8s(self, dec: &mut Decoder) -> Result<Vec<i8>, MltError>

Source

pub fn decode_u8s(self, dec: &mut Decoder) -> Result<Vec<u8>, MltError>

Source

pub fn decode_i32s(self, dec: &mut Decoder) -> Result<Vec<i32>, MltError>

Source

pub fn decode_u32s(self, dec: &mut Decoder) -> Result<Vec<u32>, MltError>

Source

pub fn decode_u64s(self, dec: &mut Decoder) -> Result<Vec<u64>, MltError>

Source

pub fn decode_i64s(self, dec: &mut Decoder) -> Result<Vec<i64>, MltError>

Source

pub fn decode_f32s(self, dec: &mut Decoder) -> Result<Vec<f32>, MltError>

Decode a stream of f32 values from raw little-endian bytes, charging dec.

Source

pub fn decode_f64s(self, dec: &mut Decoder) -> Result<Vec<f64>, MltError>

Decode a stream of f64 values from raw little-endian bytes, charging dec.

Source

pub fn decode_bits_u32( self, buf: &mut Vec<u32>, dec: &mut Decoder, ) -> MltResult<()>

Physically decode the stream into buf as u32 values.

buf is cleared and filled with the decoded words. The caller owns the buffer and is responsible for deciding whether it constitutes a final persistent allocation (and therefore should be charged to a Decoder).

Source

pub fn decode_bits_u64( self, buf: &mut Vec<u64>, dec: &mut Decoder, ) -> MltResult<()>

Physically decode the stream into buf as u64 values.

buf is cleared and filled with the decoded words. The caller owns the buffer and is responsible for deciding whether it constitutes a final persistent allocation (and therefore should be charged to a Decoder).

Source§

impl<'a> RawStream<'a>

Source

pub fn new(meta: StreamMeta, data: RawStreamData<'a>) -> Self

Source

pub fn as_bytes(&self) -> &'a [u8]

Source

pub fn from_bytes( input: &'a [u8], parser: &mut Parser, ) -> MltRefResult<'a, Self>

Source

pub fn parse_multiple( input: &'a [u8], count: usize, parser: &mut Parser, ) -> MltRefResult<'a, Vec<Self>>

Source

pub fn parse_bool( input: &'a [u8], parser: &mut Parser, ) -> MltRefResult<'a, Self>

Trait Implementations§

Source§

impl Analyze for RawStream<'_>

Source§

fn for_each_stream(&self, cb: &mut dyn FnMut(StreamMeta))

Call cb with the StreamMeta of every stream contained in self. Default implementation is a no-op (types that hold no streams).
Source§

fn collect_statistic(&self, _stat: StatType) -> usize

Source§

impl<'a> Clone for RawStream<'a>

Source§

fn clone(&self) -> RawStream<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for RawStream<'a>

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a> PartialEq for RawStream<'a>

Source§

fn eq(&self, other: &RawStream<'a>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> StructuralPartialEq for RawStream<'a>

Auto Trait Implementations§

§

impl<'a> Freeze for RawStream<'a>

§

impl<'a> RefUnwindSafe for RawStream<'a>

§

impl<'a> Send for RawStream<'a>

§

impl<'a> Sync for RawStream<'a>

§

impl<'a> Unpin for RawStream<'a>

§

impl<'a> UnsafeUnpin for RawStream<'a>

§

impl<'a> UnwindSafe for RawStream<'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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V