Trait FormatType

pub trait FormatType {
    const FORMAT_TYPE: Format;

    // Provided methods
    fn into_encoded_string(bytes: Bytes) -> String { ... }
    fn from_encoded_string(data: &str) -> Result<Bytes, DecodeError> { ... }
}
Expand description

Data format representation

Required Associated Constants§

const FORMAT_TYPE: Format

The representation type

Provided Methods§

fn into_encoded_string(bytes: Bytes) -> String

Encodes data into a string.

fn from_encoded_string(data: &str) -> Result<Bytes, DecodeError>

Decodes string to bytes

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.

Implementors§