Skip to main content

Reassemble

Trait Reassemble 

Source
pub trait Reassemble<Event>:
    Default
    + WasmCompatSend
    + 'static {
    // Required methods
    fn absorb(&mut self, event: &Event);
    fn finish(self) -> Value;
}
Expand description

Rebuilds one reply’s provider document from its decoder’s events.

A fresh value per reply. absorb sees every known event of the reply, in arrival order, before the decoder decodes it; unknown and corrupt frames never reach it. finish runs once, when the reply ends, fails or is cut short; a reply that did not end yields the document so far.

Required Methods§

Source

fn absorb(&mut self, event: &Event)

Absorb one known event of the reply.

Source

fn finish(self) -> Value

The document the absorbed events add up to. Null records none.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§