Skip to main content

ValueStreamReader

Struct ValueStreamReader 

Source
pub struct ValueStreamReader<'a, 'b> {
    pub inner: &'a mut BufferReader<'b>,
}
Expand description

Stream API for reading valuetype wire bytes (CDR §15.3.4).

Fields§

§inner: &'a mut BufferReader<'b>

Inner reader.

Implementations§

Source§

impl<'a, 'b> ValueStreamReader<'a, 'b>

Source

pub fn new(inner: &'a mut BufferReader<'b>) -> Self

Constructor.

Source

pub fn read_value_tag(&mut self) -> Result<Option<String>, DecodeError>

Reads a value-tag and returns the Repository ID. Ok(None) for null-value (0x00000000 tag).

The return is Some(first_repo_id) — for multi-repo-id lists the first ID is delivered; for the full list roundtrip see Self::read_value_tag_full.

§Errors

Decode error (truncated, unknown tag type).

Source

pub fn read_value_tag_full(&mut self) -> Result<ValueTagHeader, DecodeError>

Reads a value-tag with full header information — single, multi-repo-id list, or chunked variant.

§Errors

Decode error or unknown wire tag.

Source

pub fn read_chunk_size(&mut self) -> Result<i32, DecodeError>

Reads a chunk within a chunked-encoded value. The return is the chunk size in bytes (positive) or a negative end-tag (Spec §15.3.4.3 — -nesting_level marks the end of the chunked value).

§Errors

Decode error.

Auto Trait Implementations§

§

impl<'a, 'b> !UnwindSafe for ValueStreamReader<'a, 'b>

§

impl<'a, 'b> Freeze for ValueStreamReader<'a, 'b>

§

impl<'a, 'b> RefUnwindSafe for ValueStreamReader<'a, 'b>

§

impl<'a, 'b> Send for ValueStreamReader<'a, 'b>

§

impl<'a, 'b> Sync for ValueStreamReader<'a, 'b>

§

impl<'a, 'b> Unpin for ValueStreamReader<'a, 'b>

§

impl<'a, 'b> UnsafeUnpin for ValueStreamReader<'a, 'b>

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.