Trait sval::Stream

source ·
pub trait Stream<'sval> {
Show 51 methods // Required methods fn null(&mut self) -> Result; fn bool(&mut self, value: bool) -> Result; fn text_begin(&mut self, num_bytes: Option<usize>) -> Result; fn text_fragment_computed(&mut self, fragment: &str) -> Result; fn text_end(&mut self) -> Result; fn i64(&mut self, value: i64) -> Result; fn f64(&mut self, value: f64) -> Result; fn seq_begin(&mut self, num_entries: Option<usize>) -> Result; fn seq_value_begin(&mut self) -> Result; fn seq_value_end(&mut self) -> Result; fn seq_end(&mut self) -> Result; // Provided methods fn value<V: Value + ?Sized>(&mut self, v: &'sval V) -> Result { ... } fn value_computed<V: Value + ?Sized>(&mut self, v: &V) -> Result { ... } fn text_fragment(&mut self, fragment: &'sval str) -> Result { ... } fn binary_begin(&mut self, num_bytes: Option<usize>) -> Result { ... } fn binary_fragment(&mut self, fragment: &'sval [u8]) -> Result { ... } fn binary_fragment_computed(&mut self, fragment: &[u8]) -> Result { ... } fn binary_end(&mut self) -> Result { ... } fn u8(&mut self, value: u8) -> Result { ... } fn u16(&mut self, value: u16) -> Result { ... } fn u32(&mut self, value: u32) -> Result { ... } fn u64(&mut self, value: u64) -> Result { ... } fn u128(&mut self, value: u128) -> Result { ... } fn i8(&mut self, value: i8) -> Result { ... } fn i16(&mut self, value: i16) -> Result { ... } fn i32(&mut self, value: i32) -> Result { ... } fn i128(&mut self, value: i128) -> Result { ... } fn f32(&mut self, value: f32) -> Result { ... } fn map_begin(&mut self, num_entries: Option<usize>) -> Result { ... } fn map_key_begin(&mut self) -> Result { ... } fn map_key_end(&mut self) -> Result { ... } fn map_value_begin(&mut self) -> Result { ... } fn map_value_end(&mut self) -> Result { ... } fn map_end(&mut self) -> Result { ... } fn enum_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result { ... } fn enum_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result { ... } fn tagged_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result { ... } fn tagged_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result { ... } fn tag( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result { ... } fn record_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result { ... } fn record_value_begin( &mut self, tag: Option<&Tag>, label: &Label<'_> ) -> Result { ... } fn record_value_end( &mut self, tag: Option<&Tag>, label: &Label<'_> ) -> Result { ... } fn record_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result { ... } fn tuple_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result { ... } fn tuple_value_begin(&mut self, tag: Option<&Tag>, index: &Index) -> Result { ... } fn tuple_value_end(&mut self, tag: Option<&Tag>, index: &Index) -> Result { ... } fn tuple_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result { ... } fn record_tuple_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result { ... } fn record_tuple_value_begin( &mut self, tag: Option<&Tag>, label: &Label<'_>, index: &Index ) -> Result { ... } fn record_tuple_value_end( &mut self, tag: Option<&Tag>, label: &Label<'_>, index: &Index ) -> Result { ... } fn record_tuple_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result { ... }
}
Expand description

A consumer of structured data.

Required Methods§

source

fn null(&mut self) -> Result

Stream null, the absence of any other meaningful value.

source

fn bool(&mut self, value: bool) -> Result

Stream a boolean.

source

fn text_begin(&mut self, num_bytes: Option<usize>) -> Result

Start a UTF8 text string.

source

fn text_fragment_computed(&mut self, fragment: &str) -> Result

Stream a fragment of UTF8 text, borrowed for some arbitrarily short lifetime.

source

fn text_end(&mut self) -> Result

Complete a UTF8 text string.

source

fn i64(&mut self, value: i64) -> Result

Stream a signed 64bit integer.

source

fn f64(&mut self, value: f64) -> Result

Stream a 64bit binary floating point number.

source

fn seq_begin(&mut self, num_entries: Option<usize>) -> Result

Start a homogenous sequence of values.

source

fn seq_value_begin(&mut self) -> Result

Start an individual value in a sequence.

source

fn seq_value_end(&mut self) -> Result

Complete an individual value in a sequence.

source

fn seq_end(&mut self) -> Result

Complete a homogenous sequence of values.

Provided Methods§

source

fn value<V: Value + ?Sized>(&mut self, v: &'sval V) -> Result

Recurse into a nested value.

source

fn value_computed<V: Value + ?Sized>(&mut self, v: &V) -> Result

Recurse into a nested value, borrowed for some arbitrarily short lifetime.

source

fn text_fragment(&mut self, fragment: &'sval str) -> Result

Stream a fragment of UTF8 text.

source

fn binary_begin(&mut self, num_bytes: Option<usize>) -> Result

Start a bitstring.

source

fn binary_fragment(&mut self, fragment: &'sval [u8]) -> Result

Stream a fragment of a bitstring.

source

fn binary_fragment_computed(&mut self, fragment: &[u8]) -> Result

Stream a fragment of a bitstring, borrowed for some arbitrarily short lifetime.

source

fn binary_end(&mut self) -> Result

Complete a bitstring.

source

fn u8(&mut self, value: u8) -> Result

Stream an unsigned 8bit integer.

source

fn u16(&mut self, value: u16) -> Result

Stream an unsigned 16bit integer.

source

fn u32(&mut self, value: u32) -> Result

Stream an unsigned 32bit integer.

source

fn u64(&mut self, value: u64) -> Result

Stream an unsigned 64bit integer.

source

fn u128(&mut self, value: u128) -> Result

Stream an unsigned 128bit integer.

source

fn i8(&mut self, value: i8) -> Result

Stream a signed 8bit integer.

source

fn i16(&mut self, value: i16) -> Result

Stream a signed 16bit integer.

source

fn i32(&mut self, value: i32) -> Result

Stream a signed 32bit integer.

source

fn i128(&mut self, value: i128) -> Result

Stream a signed 128bit integer.

source

fn f32(&mut self, value: f32) -> Result

Stream a 32bit binary floating point number.

source

fn map_begin(&mut self, num_entries: Option<usize>) -> Result

Start a homogenous mapping of arbitrary keys to values.

source

fn map_key_begin(&mut self) -> Result

Start a key in a key-value mapping.

source

fn map_key_end(&mut self) -> Result

Complete a key in a key-value mapping.

source

fn map_value_begin(&mut self) -> Result

Start a value in a key-value mapping.

source

fn map_value_end(&mut self) -> Result

Complete a value in a key-value mapping.

source

fn map_end(&mut self) -> Result

Complete a homogenous mapping of arbitrary keys to values.

source

fn enum_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

Start a variant in an enumerated type.

source

fn enum_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

Complete a variant in an enumerated type.

source

fn tagged_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

Start a tagged value.

Tagged values may be used as enum variants.

source

fn tagged_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

Complete a tagged value.

source

fn tag( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

Stream a standalone tag.

Standalone tags may be used as enum variants.

source

fn record_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result

Start a record type.

Records may be used as enum variants.

source

fn record_value_begin(&mut self, tag: Option<&Tag>, label: &Label<'_>) -> Result

Start a field in a record.

source

fn record_value_end(&mut self, tag: Option<&Tag>, label: &Label<'_>) -> Result

Complete a field in a record.

source

fn record_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

Complete a record type.

source

fn tuple_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result

Start a tuple type.

Tuples may be used as enum variants.

source

fn tuple_value_begin(&mut self, tag: Option<&Tag>, index: &Index) -> Result

Start a field in a tuple.

source

fn tuple_value_end(&mut self, tag: Option<&Tag>, index: &Index) -> Result

Complete a field in a tuple.

source

fn tuple_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

Complete a tuple type.

source

fn record_tuple_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result

Begin a type that may be treated as either a record or a tuple.

source

fn record_tuple_value_begin( &mut self, tag: Option<&Tag>, label: &Label<'_>, index: &Index ) -> Result

Begin a field in a type that may be treated as either a record or a tuple.

source

fn record_tuple_value_end( &mut self, tag: Option<&Tag>, label: &Label<'_>, index: &Index ) -> Result

Complete a field in a type that may be treated as either a record or a tuple.

source

fn record_tuple_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

Complete a type that may be treated as either a record or a tuple.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<'sval, 'a, S> Stream<'sval> for &'a mut S
where S: Stream<'sval> + ?Sized,

source§

fn value<V: Value + ?Sized>(&mut self, v: &'sval V) -> Result

source§

fn value_computed<V: Value + ?Sized>(&mut self, v: &V) -> Result

source§

fn null(&mut self) -> Result

source§

fn u8(&mut self, value: u8) -> Result

source§

fn u16(&mut self, value: u16) -> Result

source§

fn u32(&mut self, value: u32) -> Result

source§

fn u64(&mut self, value: u64) -> Result

source§

fn u128(&mut self, value: u128) -> Result

source§

fn i8(&mut self, value: i8) -> Result

source§

fn i16(&mut self, value: i16) -> Result

source§

fn i32(&mut self, value: i32) -> Result

source§

fn i64(&mut self, value: i64) -> Result

source§

fn i128(&mut self, value: i128) -> Result

source§

fn f32(&mut self, value: f32) -> Result

source§

fn f64(&mut self, value: f64) -> Result

source§

fn bool(&mut self, value: bool) -> Result

source§

fn text_begin(&mut self, num_bytes: Option<usize>) -> Result

source§

fn text_end(&mut self) -> Result

source§

fn text_fragment(&mut self, fragment: &'sval str) -> Result

source§

fn text_fragment_computed(&mut self, fragment: &str) -> Result

source§

fn binary_begin(&mut self, num_bytes: Option<usize>) -> Result

source§

fn binary_end(&mut self) -> Result

source§

fn binary_fragment(&mut self, fragment: &'sval [u8]) -> Result

source§

fn binary_fragment_computed(&mut self, fragment: &[u8]) -> Result

source§

fn map_begin(&mut self, num_entries: Option<usize>) -> Result

source§

fn map_end(&mut self) -> Result

source§

fn map_key_begin(&mut self) -> Result

source§

fn map_key_end(&mut self) -> Result

source§

fn map_value_begin(&mut self) -> Result

source§

fn map_value_end(&mut self) -> Result

source§

fn seq_begin(&mut self, num_entries: Option<usize>) -> Result

source§

fn seq_end(&mut self) -> Result

source§

fn seq_value_begin(&mut self) -> Result

source§

fn seq_value_end(&mut self) -> Result

source§

fn tagged_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn tagged_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn tag( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn record_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result

source§

fn record_value_begin(&mut self, tag: Option<&Tag>, label: &Label<'_>) -> Result

source§

fn record_value_end(&mut self, tag: Option<&Tag>, label: &Label<'_>) -> Result

source§

fn record_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn tuple_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result

source§

fn tuple_value_begin(&mut self, tag: Option<&Tag>, index: &Index) -> Result

source§

fn tuple_value_end(&mut self, tag: Option<&Tag>, index: &Index) -> Result

source§

fn tuple_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn record_tuple_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result

source§

fn record_tuple_value_begin( &mut self, tag: Option<&Tag>, label: &Label<'_>, index: &Index ) -> Result

source§

fn record_tuple_value_end( &mut self, tag: Option<&Tag>, label: &Label<'_>, index: &Index ) -> Result

source§

fn record_tuple_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn enum_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn enum_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

impl<'sval, 'a, S> Stream<'sval> for Box<S>
where S: Stream<'sval> + ?Sized,

source§

fn value<V: Value + ?Sized>(&mut self, v: &'sval V) -> Result

source§

fn value_computed<V: Value + ?Sized>(&mut self, v: &V) -> Result

source§

fn null(&mut self) -> Result

source§

fn u8(&mut self, value: u8) -> Result

source§

fn u16(&mut self, value: u16) -> Result

source§

fn u32(&mut self, value: u32) -> Result

source§

fn u64(&mut self, value: u64) -> Result

source§

fn u128(&mut self, value: u128) -> Result

source§

fn i8(&mut self, value: i8) -> Result

source§

fn i16(&mut self, value: i16) -> Result

source§

fn i32(&mut self, value: i32) -> Result

source§

fn i64(&mut self, value: i64) -> Result

source§

fn i128(&mut self, value: i128) -> Result

source§

fn f32(&mut self, value: f32) -> Result

source§

fn f64(&mut self, value: f64) -> Result

source§

fn bool(&mut self, value: bool) -> Result

source§

fn text_begin(&mut self, num_bytes: Option<usize>) -> Result

source§

fn text_end(&mut self) -> Result

source§

fn text_fragment(&mut self, fragment: &'sval str) -> Result

source§

fn text_fragment_computed(&mut self, fragment: &str) -> Result

source§

fn binary_begin(&mut self, num_bytes: Option<usize>) -> Result

source§

fn binary_end(&mut self) -> Result

source§

fn binary_fragment(&mut self, fragment: &'sval [u8]) -> Result

source§

fn binary_fragment_computed(&mut self, fragment: &[u8]) -> Result

source§

fn map_begin(&mut self, num_entries: Option<usize>) -> Result

source§

fn map_end(&mut self) -> Result

source§

fn map_key_begin(&mut self) -> Result

source§

fn map_key_end(&mut self) -> Result

source§

fn map_value_begin(&mut self) -> Result

source§

fn map_value_end(&mut self) -> Result

source§

fn seq_begin(&mut self, num_entries: Option<usize>) -> Result

source§

fn seq_end(&mut self) -> Result

source§

fn seq_value_begin(&mut self) -> Result

source§

fn seq_value_end(&mut self) -> Result

source§

fn tagged_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn tagged_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn tag( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn record_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result

source§

fn record_value_begin(&mut self, tag: Option<&Tag>, label: &Label<'_>) -> Result

source§

fn record_value_end(&mut self, tag: Option<&Tag>, label: &Label<'_>) -> Result

source§

fn record_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn tuple_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result

source§

fn tuple_value_begin(&mut self, tag: Option<&Tag>, index: &Index) -> Result

source§

fn tuple_value_end(&mut self, tag: Option<&Tag>, index: &Index) -> Result

source§

fn tuple_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn record_tuple_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize> ) -> Result

source§

fn record_tuple_value_begin( &mut self, tag: Option<&Tag>, label: &Label<'_>, index: &Index ) -> Result

source§

fn record_tuple_value_end( &mut self, tag: Option<&Tag>, label: &Label<'_>, index: &Index ) -> Result

source§

fn record_tuple_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn enum_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

source§

fn enum_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index> ) -> Result

Implementors§