Flow

Trait Flow 

Source
pub trait Flow: DataFraction {
    type Action: DataFraction;
    type Event: DataFraction;

    // Required methods
    fn stream_type() -> StreamType;
    fn apply(&mut self, event: Self::Event);

    // Provided methods
    fn pack_state(&self) -> Result<PackedState, Error> { ... }
    fn unpack_state(data: &PackedState) -> Result<Self, Error> { ... }
    fn pack_event(delta: &Self::Event) -> Result<PackedEvent, Error> { ... }
    fn unpack_event(data: &PackedEvent) -> Result<Self::Event, Error> { ... }
    fn pack_action(action: &Self::Action) -> Result<PackedAction, Error> { ... }
    fn unpack_action(data: &PackedAction) -> Result<Self::Action, Error> { ... }
}
Expand description

Immutable state of a data flow.

Required Associated Types§

Source

type Action: DataFraction

ControlEvent - that send from a client to a server

Source

type Event: DataFraction

UpdateEvent - that sent from a server to a client

Required Methods§

Source

fn stream_type() -> StreamType

Source

fn apply(&mut self, event: Self::Event)

Provided Methods§

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§