Trait Pathway

Source
pub trait Pathway {
    type Capture: 'static;
    type Backend: for<'a> Backend<Self::Key<'a>> + Send + Sync + 'static;
    type Format: Format;
    type Key<'a>;

    // Required methods
    fn key(&self) -> Self::Key<'_>;
    fn capture(&self, world: &World) -> impl FlowLabel;
    fn apply(&self, world: &World) -> impl FlowLabel;
}
Expand description

Trait that defines how exactly your app saves and loads.

Unlike Pipeline, Pathway allows you to define custom capture types and utilize Flows.

Required Associated Types§

Source

type Capture: 'static

The type to be captured from and applied to the world

Source

type Backend: for<'a> Backend<Self::Key<'a>> + Send + Sync + 'static

The interface between the saver / loader and data storage.

Source

type Format: Format

The format used for serializing and deserializing data.

Source

type Key<'a>

Used to uniquely identify each saved capture.

Required Methods§

Source

fn key(&self) -> Self::Key<'_>

Retrieve the unique identifier for the capture being processed by the Pathway.

Source

fn capture(&self, world: &World) -> impl FlowLabel

The label of the capture Flow the Pathway will use

Source

fn apply(&self, world: &World) -> impl FlowLabel

The label of the apply Flow the Pathway will use

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§

Source§

impl<P> Pathway for P
where P: Pipeline + 'static,

Available on crate feature reflect only.