Trait druid::widget::ScopePolicy
source · pub trait ScopePolicy {
type In: Data;
type State: Data;
type Transfer: ScopeTransfer<In = Self::In, State = Self::State>;
// Required method
fn create(self, inner: &Self::In) -> (Self::State, Self::Transfer);
}
Expand description
A policy that controls how a Scope
will interact with its surrounding
application data. Specifically, how to create an initial State from the
input, and how to synchronise the two using a ScopeTransfer
.
Required Associated Types§
sourcetype State: Data
type State: Data
The type of data that the Scope
will maintain internally.
This will usually be larger than the input data, and will embed the input data.
sourcetype Transfer: ScopeTransfer<In = Self::In, State = Self::State>
type Transfer: ScopeTransfer<In = Self::In, State = Self::State>
The type of transfer that will be used to synchronise internal and application state