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§
Required Methods§
fn read_input(&self, state: &mut Self::State, input: &Self::In)
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)
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.