Encoder

Trait Encoder 

Source
pub trait Encoder {
    type Error;

    // Required method
    fn encode(
        &self,
        message: &str,
    ) -> Result<(Vec<u8>, DataCoding), Self::Error>;
}
Available on crate features encoding and alloc only.
Expand description

A trait for encoding messages into byte vectors.

Required Associated Types§

Source

type Error

The type of errors that can occur during encoding.

Required Methods§

Source

fn encode(&self, message: &str) -> Result<(Vec<u8>, DataCoding), Self::Error>

Encodes the given message into a vector of bytes and its associated DataCoding.

Implementors§