Skip to main content

Relayed

Trait Relayed 

Source
pub trait Relayed: Point {
    // Required methods
    fn encode(input: &Self::Input) -> String;
    fn decode(text: &str) -> Result<Self::Input, String>;
}
Expand description

An event point whose input can cross a process: written as text by one bus, read back by another (Relay).

The format is the application’s (JSON, most often), the same on both ends. Two processes of different versions read each other: a decoder should accept fields it does not know and fill the ones it misses, and fail only on a payload it cannot use.

Required Methods§

Source

fn encode(input: &Self::Input) -> String

The input as text.

Source

fn decode(text: &str) -> Result<Self::Input, String>

The input read back from text, or why it cannot be.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§