Skip to main content

Encoder

Trait Encoder 

Source
pub trait Encoder {
    type Output;
    type Error;

    // Required method
    fn encode(&self, input: &[u8]) -> Result<Self::Output, Self::Error>;
}
Expand description

Encodes raw input bytes into a concrete output type.

Implementations can produce a full QR code, an intermediate bit stream, or a third-party symbol type. The input is borrowed to keep the trait usable in no_std + alloc environments without requiring an owned buffer.

Required Associated Types§

Source

type Output

The successful encoding output.

Source

type Error

The encoding error type.

Required Methods§

Source

fn encode(&self, input: &[u8]) -> Result<Self::Output, Self::Error>

Encodes input.

§Errors

Returns Self::Error when the implementation cannot encode the input.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§