FormatType

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.

Implementations on Foreign Typesยง

ยง

impl FormatType for Encoder

ยง

const FORMAT_TYPE: Format = server_fn::error::ServerFnErrorEncoding::FORMAT_TYPE

Implementorsยง