Skip to main content

OutputCodec

Trait OutputCodec 

Source
pub trait OutputCodec<V: ?Sized> {
    type Output;

    // Required methods
    fn metadata(&self) -> &'static CodecMetadata;
    fn encode(&self, value: &V) -> Self::Output;
}
Expand description

Encode a public algebra value of type V.

Textual codecs use Output = String; algebra-owned display codecs use Output = VisualRepresentation.

Required Associated Types§

Source

type Output

The representation produced by this codec.

Required Methods§

Source

fn metadata(&self) -> &'static CodecMetadata

Return static codec metadata. This must not inspect or encode a value.

Source

fn encode(&self, value: &V) -> Self::Output

Encode value.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§