Skip to main content

DxSerializable

Trait DxSerializable 

Source
pub trait DxSerializable: Sized {
    // Required methods
    fn to_dx_llm(&self) -> Result<String>;
    fn from_dx_llm(content: &str) -> Result<Self>;
    fn to_dx_machine(&self) -> Result<Vec<u8>>;
    fn from_dx_machine(data: &[u8]) -> Result<Self>;
}
Expand description

Trait for types that can be serialized to/from DX formats

Required Methods§

Source

fn to_dx_llm(&self) -> Result<String>

Serialize to DX LLM format (human/LLM readable text)

Source

fn from_dx_llm(content: &str) -> Result<Self>

Deserialize from DX LLM format

Source

fn to_dx_machine(&self) -> Result<Vec<u8>>

Serialize to DX Machine format (binary)

Source

fn from_dx_machine(data: &[u8]) -> Result<Self>

Deserialize from DX Machine format

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§