Skip to main content

StreamWriterTrait

Trait StreamWriterTrait 

Source
pub trait StreamWriterTrait:
    Send
    + Sync
    + 'static {
    // Required method
    fn emit_custom(&self, node: &str, data: Value);
}
Expand description

Non-generic stream writer trait for Runtime integration.

StreamWriter<S> is parameterized over the state type S which prevents it from being stored directly in Runtime<C>. This trait provides type-erased access so nodes can emit custom stream events through the runtime regardless of the state type.

Required Methods§

Source

fn emit_custom(&self, node: &str, data: Value)

Emit a custom stream data payload.

Trait Implementations§

Source§

impl Debug for dyn StreamWriterTrait

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl StreamWriterTrait for UnboundedSender<(String, Value)>

Source§

fn emit_custom(&self, node: &str, data: Value)

Implementors§