Skip to main content

TextCodec

Trait TextCodec 

Source
pub trait TextCodec: Harness + Sized {
    // Required methods
    fn from_text(text: &str) -> Result<Transcript<Self>>;
    fn to_text(transcript: &Transcript<Self>) -> Result<String>;
}
Expand description

Parsing and rendering a harness’s native session text, free of any filesystem or database. Store layers location on top of it; the WASM bindings use it directly.

Required Methods§

Source

fn from_text(text: &str) -> Result<Transcript<Self>>

Parse native session text into a transcript. meta.id may be empty when the text carries no internal id; a Store fills it from the filename.

§Errors

When the text is not this harness’s session format.

Source

fn to_text(transcript: &Transcript<Self>) -> Result<String>

Render a transcript back to native session text.

§Errors

When the records cannot be serialized.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§