[−][src]Struct ion_rs::BinaryIonCursor
Implementations
impl<T> BinaryIonCursor<Cursor<T>> where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
Additional functionality that's only available if the data source is in-memory, such as a
Vec
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]
R: IonDataSource,
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]
F: FnOnce(&[u8]) -> T,
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]
F: FnOnce(&[u8]) -> T,
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
fn ion_version(&self) -> (u8, u8)
[src]
fn next(&mut self) -> IonResult<Option<StreamItem>>
[src]
fn ion_type(&self) -> Option<IonType>
[src]
fn annotation_ids(&self) -> &[SymbolId]
[src]
fn field_id(&self) -> Option<SymbolId>
[src]
fn read_null(&mut self) -> IonResult<Option<IonType>>
[src]
fn read_bool(&mut self) -> IonResult<Option<bool>>
[src]
fn read_i64(&mut self) -> IonResult<Option<i64>>
[src]
fn read_f32(&mut self) -> IonResult<Option<f32>>
[src]
fn read_f64(&mut self) -> IonResult<Option<f64>>
[src]
fn read_big_decimal(&mut self) -> IonResult<Option<BigDecimal>>
[src]
fn read_string(&mut self) -> IonResult<Option<String>>
[src]
fn string_ref_map<F, T>(&mut self, f: F) -> IonResult<Option<T>> where
F: FnOnce(&str) -> T,
[src]
F: FnOnce(&str) -> T,
fn string_bytes_map<F, T>(&mut self, f: F) -> IonResult<Option<T>> where
F: FnOnce(&[u8]) -> T,
[src]
F: FnOnce(&[u8]) -> T,
fn read_symbol_id(&mut self) -> IonResult<Option<SymbolId>>
[src]
fn read_blob_bytes(&mut self) -> IonResult<Option<Vec<u8>>>
[src]
fn read_clob_bytes(&mut self) -> IonResult<Option<Vec<u8>>>
[src]
fn read_datetime(&mut self) -> IonResult<Option<DateTime<FixedOffset>>>
[src]
fn step_in(&mut self) -> IonResult<()>
[src]
fn step_out(&mut self) -> IonResult<()>
[src]
fn depth(&self) -> usize
[src]
Auto Trait Implementations
impl<R> RefUnwindSafe for BinaryIonCursor<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for BinaryIonCursor<R> where
R: Send,
R: Send,
impl<R> Sync for BinaryIonCursor<R> where
R: Sync,
R: Sync,
impl<R> Unpin for BinaryIonCursor<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for BinaryIonCursor<R> where
R: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,