pub trait StreamEnum<'sval> {
type Ok;
type Tuple: StreamTuple<'sval, Ok = Self::Ok>;
type Record: StreamRecord<'sval, Ok = Self::Ok>;
type Nested: StreamEnum<'sval, Ok = Self::Ok, Nested = Self::Nested>;
// Required methods
fn tag(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
) -> Result<Self::Ok>;
fn tagged_computed<V: Value>(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
value: V,
) -> Result<Self::Ok>;
fn tuple_begin(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
num_entries: Option<usize>,
) -> Result<Self::Tuple>;
fn record_begin(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
num_entries: Option<usize>,
) -> Result<Self::Record>;
fn nested<F: FnOnce(Self::Nested) -> Result<<Self::Nested as StreamEnum<'sval>>::Ok>>(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
variant: F,
) -> Result<Self::Ok>;
fn empty(self) -> Result<Self::Ok>;
// Provided methods
fn tagged<V: ValueRef<'sval>>(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
value: V,
) -> Result<Self::Ok>
where Self: Sized { ... }
fn tagged_ref<V: Value + ?Sized>(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
value: &'sval V,
) -> Result<Self::Ok>
where Self: Sized { ... }
}Expand description
A stream for an enum.
Required Associated Types§
Sourcetype Tuple: StreamTuple<'sval, Ok = Self::Ok>
type Tuple: StreamTuple<'sval, Ok = Self::Ok>
Stream a tuple variant.
Sourcetype Record: StreamRecord<'sval, Ok = Self::Ok>
type Record: StreamRecord<'sval, Ok = Self::Ok>
Stream a record variant.
Sourcetype Nested: StreamEnum<'sval, Ok = Self::Ok, Nested = Self::Nested>
type Nested: StreamEnum<'sval, Ok = Self::Ok, Nested = Self::Nested>
Stream a nested enum variant.
Required Methods§
Sourcefn tag(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
) -> Result<Self::Ok>
fn tag( self, tag: Option<Tag>, label: Option<Label<'_>>, index: Option<Index>, ) -> Result<Self::Ok>
Stream a tag variant.
Sourcefn tagged_computed<V: Value>(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
value: V,
) -> Result<Self::Ok>
fn tagged_computed<V: Value>( self, tag: Option<Tag>, label: Option<Label<'_>>, index: Option<Index>, value: V, ) -> Result<Self::Ok>
Stream a tagged value variant, borrowed for an arbitrarily short lifetime.
Sourcefn tuple_begin(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
num_entries: Option<usize>,
) -> Result<Self::Tuple>
fn tuple_begin( self, tag: Option<Tag>, label: Option<Label<'_>>, index: Option<Index>, num_entries: Option<usize>, ) -> Result<Self::Tuple>
Stream a tuple variant.
Sourcefn record_begin(
self,
tag: Option<Tag>,
label: Option<Label<'_>>,
index: Option<Index>,
num_entries: Option<usize>,
) -> Result<Self::Record>
fn record_begin( self, tag: Option<Tag>, label: Option<Label<'_>>, index: Option<Index>, num_entries: Option<usize>, ) -> Result<Self::Record>
Stream a record variant.
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.