Skip to main content

Encode

Trait Encode 

Source
pub trait Encode: AsnType {
    // Required method
    fn encode(&self, writer: &mut Writer<'_>) -> Result<(), Error>;
}
Expand description

A type whose values are written in aligned PER. The example of Decode implements it.

Required Methods§

Source

fn encode(&self, writer: &mut Writer<'_>) -> Result<(), Error>

Write the value.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl Encode for ()

Source§

fn encode(&self, _: &mut Writer<'_>) -> Result<(), Error>

Source§

impl Encode for bool

Source§

fn encode(&self, writer: &mut Writer<'_>) -> Result<(), Error>

Implementors§

Source§

impl Encode for Octets<'_>