pub trait DcMixedFields: DcMixedDecode {
// Required methods
fn dc_field_owner() -> &'static str;
fn encode_dc_field_to(
&self,
field: &str,
target: &mut DcWriter<'_>,
) -> Result<()>;
// Provided methods
fn encode_dc_field(&self, field: &str, target: &mut DcMstring) -> Result<()> { ... }
fn encode_dc_map_field(
&self,
field: &str,
target: &mut DcMstring,
encoding: DcKvMapEncoding,
) -> Result<()> { ... }
fn encode_dc_map_field_to(
&self,
field: &str,
target: &mut DcWriter<'_>,
encoding: DcKvMapEncoding,
) -> Result<()> { ... }
fn accepts_dc_tag(_tag: u128) -> bool { ... }
fn encode_fields_with_context(
&self,
_mst: &mut DcWriter<'_>,
_context: &SharedValueContext,
) -> Result<()> { ... }
fn decode_field(
&mut self,
_tag: u128,
_ctx: &mut DcProjectionContext<'_, '_>,
_node_id: NodeId,
) -> Result<bool> { ... }
}Expand description
Field encoding supplied by tagged-record derives, using inline bindings.
Required Methods§
Sourcefn dc_field_owner() -> &'static str
fn dc_field_owner() -> &'static str
Identifies the record owning the generated field annotations.
Provided Methods§
fn encode_dc_field(&self, field: &str, target: &mut DcMstring) -> Result<()>
fn encode_dc_map_field( &self, field: &str, target: &mut DcMstring, encoding: DcKvMapEncoding, ) -> Result<()>
Sourcefn encode_dc_map_field_to(
&self,
field: &str,
target: &mut DcWriter<'_>,
encoding: DcKvMapEncoding,
) -> Result<()>
fn encode_dc_map_field_to( &self, field: &str, target: &mut DcWriter<'_>, encoding: DcKvMapEncoding, ) -> Result<()>
Encodes a keyed field using the source array’s framing.
§Errors
Returns an error if this record does not support keyed field encoding.
Sourcefn accepts_dc_tag(_tag: u128) -> bool
fn accepts_dc_tag(_tag: u128) -> bool
Returns whether tag is one of this record’s direct or flattened field tags.
Sourcefn encode_fields_with_context(
&self,
_mst: &mut DcWriter<'_>,
_context: &SharedValueContext,
) -> Result<()>
fn encode_fields_with_context( &self, _mst: &mut DcWriter<'_>, _context: &SharedValueContext, ) -> Result<()>
Encodes all fields of this record without wrapping in its outer container.
§Errors
Returns an error if field encoding fails.
Sourcefn decode_field(
&mut self,
_tag: u128,
_ctx: &mut DcProjectionContext<'_, '_>,
_node_id: NodeId,
) -> Result<bool>
fn decode_field( &mut self, _tag: u128, _ctx: &mut DcProjectionContext<'_, '_>, _node_id: NodeId, ) -> Result<bool>
Decodes a single tagged field node into self, returning true if tag matched.
§Errors
Returns an error if decoding the matched field fails.
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.