pub trait DcMixedFlattened: Sized {
type State: Default;
// Required methods
fn encode_flattened_fields(
&self,
mst: &mut DcWriter<'_>,
context: &SharedValueContext,
) -> Result<()>;
fn decode_flattened_field(
state: &mut Self::State,
tag: u128,
ctx: &mut DcProjectionContext<'_, '_>,
val_id: NodeId,
source_node: NodeId,
) -> Result<bool>;
fn finish_flattened(
state: Self::State,
ctx: &mut DcProjectionContext<'_, '_>,
) -> Result<Self>;
// Provided method
fn encode_empty_flattened_marker(
&self,
_mst: &mut DcWriter<'_>,
_context: &SharedValueContext,
) -> Result<()> { ... }
}Expand description
Trait for types whose fields can be serialized or deserialized in a flattened context.
Required Associated Types§
Required Methods§
fn encode_flattened_fields( &self, mst: &mut DcWriter<'_>, context: &SharedValueContext, ) -> Result<()>
fn decode_flattened_field( state: &mut Self::State, tag: u128, ctx: &mut DcProjectionContext<'_, '_>, val_id: NodeId, source_node: NodeId, ) -> Result<bool>
fn finish_flattened( state: Self::State, ctx: &mut DcProjectionContext<'_, '_>, ) -> Result<Self>
Provided Methods§
fn encode_empty_flattened_marker( &self, _mst: &mut DcWriter<'_>, _context: &SharedValueContext, ) -> Result<()>
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.