pub struct FlattenToTuple<'sval, S> { /* private fields */ }Expand description
A stream that flattens the fields of a value onto a tuple.
Implementations§
Source§impl<'sval, S: Stream<'sval>> FlattenToTuple<'sval, S>
impl<'sval, S: Stream<'sval>> FlattenToTuple<'sval, S>
Sourcepub fn new(stream: S, offset: isize) -> Self
pub fn new(stream: S, offset: isize) -> Self
Wrap the given stream.
The offset is the current length of the tuple being flattened onto.
Call FlattenToTuple::end after streaming a value to get the new length of the tuple.
Trait Implementations§
Source§impl<'sval, S: Stream<'sval>> Stream<'sval> for FlattenToTuple<'sval, S>
impl<'sval, S: Stream<'sval>> Stream<'sval> for FlattenToTuple<'sval, S>
Source§fn value_computed<V: Value + ?Sized>(&mut self, v: &V) -> Result
fn value_computed<V: Value + ?Sized>(&mut self, v: &V) -> Result
Recurse into a nested value, borrowed for some arbitrarily short lifetime.
Source§fn null(&mut self) -> Result
fn null(&mut self) -> Result
Stream null, the absence of any other meaningful value. Read more
Source§fn f32(&mut self, value: f32) -> Result
fn f32(&mut self, value: f32) -> Result
Stream a 32bit binary floating point number. Read more
Source§fn f64(&mut self, value: f64) -> Result
fn f64(&mut self, value: f64) -> Result
Stream a 64bit binary floating point number. Read more
Source§fn text_begin(&mut self, num_bytes: Option<usize>) -> Result
fn text_begin(&mut self, num_bytes: Option<usize>) -> Result
Start a UTF8 text string. Read more
Source§fn text_fragment(&mut self, fragment: &'sval str) -> Result
fn text_fragment(&mut self, fragment: &'sval str) -> Result
Stream a fragment of UTF8 text. Read more
Source§fn text_fragment_computed(&mut self, fragment: &str) -> Result
fn text_fragment_computed(&mut self, fragment: &str) -> Result
Stream a fragment of UTF8 text, borrowed for some arbitrarily short lifetime. Read more
Source§fn binary_end(&mut self) -> Result
fn binary_end(&mut self) -> Result
Complete a bitstring. Read more
Source§fn binary_fragment(&mut self, fragment: &'sval [u8]) -> Result
fn binary_fragment(&mut self, fragment: &'sval [u8]) -> Result
Stream a fragment of a bitstring. Read more
Source§fn binary_fragment_computed(&mut self, fragment: &[u8]) -> Result
fn binary_fragment_computed(&mut self, fragment: &[u8]) -> Result
Stream a fragment of a bitstring, borrowed for some arbitrarily short lifetime. Read more
Source§fn map_begin(&mut self, num_entries: Option<usize>) -> Result
fn map_begin(&mut self, num_entries: Option<usize>) -> Result
Start a heterogeneous mapping of arbitrary keys to values. Read more
Source§fn map_end(&mut self) -> Result
fn map_end(&mut self) -> Result
Complete a heterogeneous mapping of arbitrary keys to values. Read more
Source§fn map_key_begin(&mut self) -> Result
fn map_key_begin(&mut self) -> Result
Start a key in a key-value mapping. Read more
Source§fn map_key_end(&mut self) -> Result
fn map_key_end(&mut self) -> Result
Complete a key in a key-value mapping. Read more
Source§fn map_value_begin(&mut self) -> Result
fn map_value_begin(&mut self) -> Result
Start a value in a key-value mapping. Read more
Source§fn map_value_end(&mut self) -> Result
fn map_value_end(&mut self) -> Result
Complete a value in a key-value mapping. Read more
Source§fn seq_begin(&mut self, num_entries: Option<usize>) -> Result
fn seq_begin(&mut self, num_entries: Option<usize>) -> Result
Start a heterogeneous sequence of values. Read more
Source§fn seq_value_begin(&mut self) -> Result
fn seq_value_begin(&mut self) -> Result
Start an individual value in a sequence. Read more
Source§fn seq_value_end(&mut self) -> Result
fn seq_value_end(&mut self) -> Result
Complete an individual value in a sequence. Read more
Source§fn tagged_begin(
&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
Start a tagged value. Read more
Source§fn tagged_end(
&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
Complete a tagged value. Read more
Source§fn tag(
&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
Stream a standalone tag. Read more
Source§fn tag_hint(&mut self, tag: &Tag) -> Result
fn tag_hint(&mut self, tag: &Tag) -> Result
Use a tag as a hint without streaming it as a value. Read more
Source§fn record_begin(
&mut self,
tag: Option<&Tag>,
label: Option<&Label<'_>>,
index: Option<&Index>,
num_entries: Option<usize>,
) -> Result
fn record_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize>, ) -> Result
Start a record. Read more
Source§fn record_value_begin(&mut self, tag: Option<&Tag>, label: &Label<'_>) -> Result
fn record_value_begin(&mut self, tag: Option<&Tag>, label: &Label<'_>) -> Result
Start a field in a record. Read more
Source§fn record_value_end(&mut self, tag: Option<&Tag>, label: &Label<'_>) -> Result
fn record_value_end(&mut self, tag: Option<&Tag>, label: &Label<'_>) -> Result
Complete a field in a record. Read more
Source§fn record_end(
&mut self,
tag: Option<&Tag>,
label: Option<&Label<'_>>,
index: Option<&Index>,
) -> Result
fn record_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, ) -> Result
Complete a record. Read more
Source§fn tuple_begin(
&mut self,
tag: Option<&Tag>,
label: Option<&Label<'_>>,
index: Option<&Index>,
num_entries: Option<usize>,
) -> Result
fn tuple_begin( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, num_entries: Option<usize>, ) -> Result
Start a tuple. Read more
Source§fn tuple_value_begin(&mut self, tag: Option<&Tag>, index: &Index) -> Result
fn tuple_value_begin(&mut self, tag: Option<&Tag>, index: &Index) -> Result
Start a field in a tuple. Read more
Source§fn tuple_value_end(&mut self, tag: Option<&Tag>, index: &Index) -> Result
fn tuple_value_end(&mut self, tag: Option<&Tag>, index: &Index) -> Result
Complete a field in a tuple. Read more
Source§fn tuple_end(
&mut self,
tag: Option<&Tag>,
label: Option<&Label<'_>>,
index: Option<&Index>,
) -> Result
fn tuple_end( &mut self, tag: Option<&Tag>, label: Option<&Label<'_>>, index: Option<&Index>, ) -> Result
Complete a tuple. Read more
Source§fn record_tuple_begin(
&mut self,
tag: Option<&Tag>,
label: Option<&Label<'_>>,
index: Option<&Index>,
num_entries: Option<usize>,
) -> Result
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. Read more
Source§fn record_tuple_value_begin(
&mut self,
tag: Option<&Tag>,
label: &Label<'_>,
index: &Index,
) -> Result
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. Read more
Source§fn record_tuple_value_end(
&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
Complete a field in a type that may be treated as either a record or a tuple. Read more
Source§fn record_tuple_end(
&mut self,
tag: Option<&Tag>,
label: Option<&Label<'_>>,
index: Option<&Index>,
) -> Result
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. Read more
Auto Trait Implementations§
impl<'sval, S> Freeze for FlattenToTuple<'sval, S>where
S: Freeze,
impl<'sval, S> RefUnwindSafe for FlattenToTuple<'sval, S>where
S: RefUnwindSafe,
impl<'sval, S> Send for FlattenToTuple<'sval, S>where
S: Send,
impl<'sval, S> Sync for FlattenToTuple<'sval, S>where
S: Sync,
impl<'sval, S> Unpin for FlattenToTuple<'sval, S>where
S: Unpin,
impl<'sval, S> UnsafeUnpin for FlattenToTuple<'sval, S>where
S: UnsafeUnpin,
impl<'sval, S> UnwindSafe for FlattenToTuple<'sval, S>where
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more