Skip to main content

StreamEventExt

Trait StreamEventExt 

Source
pub trait StreamEventExt<M>: Sized {
    // Required methods
    fn from_message(msg: M) -> Self;
    fn from_error(err: String) -> Self;
    fn partial(partial: String, error: Option<String>) -> Self;
}
Expand description

Small conversion trait so endpoint-specific event enums can be constructed from a successful message M, an error string, or a partial payload.

Required Methods§

Source

fn from_message(msg: M) -> Self

Create an event from a successfully deserialized message.

Source

fn from_error(err: String) -> Self

Create an event from an error string.

Source

fn partial(partial: String, error: Option<String>) -> Self

Create a partial event (with optional error text).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§