pub trait DcMixedNumber: Sized {
// Required methods
fn encode_dc_number(&self, mst: &mut DcWriter<'_>) -> Result<()>;
fn decode_dc_number(
ctx: &mut DcProjectionContext<'_, '_>,
node_id: NodeId,
) -> Result<Self>;
}Expand description
Trait for types that can convert to and from a numeric Dc representation.
Used for fields with equivalent numeric representations (equivalents = (..., number)).
Required Methods§
Sourcefn encode_dc_number(&self, mst: &mut DcWriter<'_>) -> Result<()>
fn encode_dc_number(&self, mst: &mut DcWriter<'_>) -> Result<()>
Sourcefn decode_dc_number(
ctx: &mut DcProjectionContext<'_, '_>,
node_id: NodeId,
) -> Result<Self>
fn decode_dc_number( ctx: &mut DcProjectionContext<'_, '_>, node_id: NodeId, ) -> Result<Self>
Deserializes an instance from a numeric Dc representation.
§Errors
Returns an error if decoding fails or the number cannot be converted.
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.