pub trait ScopeTransfer {
    type In: Data;
    type State: Data;

    // Required methods
    fn read_input(&self, state: &mut Self::State, input: &Self::In);
    fn write_back_input(&self, state: &Self::State, input: &mut Self::In);
}
Expand description

A ScopeTransfer knows how to synchronise input data with its counterpart within a Scope.

It is separate from the policy mainly to allow easy use of lenses to do synchronisation, with a custom ScopePolicy.

Required Associated Types§

type In: Data

The type of data that comes in from the surrounding application or scope.

type State: Data

The type of data that the Scope will maintain internally.

Required Methods§

fn read_input(&self, state: &mut Self::State, input: &Self::In)

Replace the input we have within our State with a new one from outside

fn write_back_input(&self, state: &Self::State, input: &mut Self::In)

Take the modifications we have made and write them back to our input.

Implementors§

§

impl<L, In, State> ScopeTransfer for LensScopeTransfer<L, In, State>where L: Lens<State, In>, In: Data, State: Data,

§

type In = In

§

type State = State