[][src]Struct ion_rs::BinaryIonCursor

pub struct BinaryIonCursor<R> where
    R: IonDataSource
{ /* fields omitted */ }

Implementations

impl<T> BinaryIonCursor<Cursor<T>> where
    T: AsRef<[u8]>, 
[src]

Additional functionality that's only available if the data source is in-memory, such as a Vec or &u8).

pub fn raw_bytes(&self) -> Option<&[u8]>[src]

Returns a slice containing the entirety of this encoded value, including its field ID (if present), its annotations (if present), its header, and the encoded value itself. Calling this function does not advance the cursor.

pub fn raw_header_bytes(&self) -> Option<&[u8]>[src]

Returns a slice containing the current value's header's raw bytes without advancing the cursor. Includes the type descriptor byte and any bytes used to represent the length field.

pub fn raw_value_bytes(&self) -> Option<&[u8]>[src]

Returns a slice containing the current value's raw bytes (not including its field ID, annotations, or type descriptor byte) without advancing the cursor.

pub fn raw_field_id_bytes(&self) -> Option<&[u8]>[src]

Returns a slice containing the current value's raw field ID bytes (if present) without advancing the cursor.

pub fn raw_annotations_bytes(&self) -> Option<&[u8]>[src]

Returns a slice containing the current value's annotations (if any) without advancing the cursor.

impl<R> BinaryIonCursor<R> where
    R: IonDataSource
[src]

pub fn new(data_source: R) -> Self[src]

pub fn is_null(&self) -> bool[src]

pub fn blob_ref_map<F, T>(&mut self, f: F) -> IonResult<Option<T>> where
    F: FnOnce(&[u8]) -> T, 
[src]

Runs the provided closure, passing in a reference to the value to be read and allowing a calculated value of any type to be returned. When possible, blob_ref_map will pass a reference directly to the bytes in the input buffer rather than copying the blob.

pub fn clob_ref_map<F, T>(&mut self, f: F) -> IonResult<Option<T>> where
    F: FnOnce(&[u8]) -> T, 
[src]

Runs the provided closure, passing in a reference to the value to be read and allowing a calculated value of any type to be returned. When possible, clob_ref_map will pass a reference directly to the bytes in the input buffer rather than copying the clob.

Trait Implementations

impl<R: IonDataSource> Cursor for BinaryIonCursor<R>[src]

type DataSource = R

Auto Trait Implementations

impl<R> RefUnwindSafe for BinaryIonCursor<R> where
    R: RefUnwindSafe

impl<R> Send for BinaryIonCursor<R> where
    R: Send

impl<R> Sync for BinaryIonCursor<R> where
    R: Sync

impl<R> Unpin for BinaryIonCursor<R> where
    R: Unpin

impl<R> UnwindSafe for BinaryIonCursor<R> where
    R: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.