[][src]Trait druid::widget::ScopePolicy

pub trait ScopePolicy {
    type In: Data;
    type State: Data;
    type Transfer: ScopeTransfer<In = Self::In, State = Self::State>;
    pub fn create(self, inner: &Self::In) -> (Self::State, Self::Transfer);
}

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.

Associated Types

type In: Data[src]

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

type State: Data[src]

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.

type Transfer: ScopeTransfer<In = Self::In, State = Self::State>[src]

The type of transfer that will be used to synchronise internal and application state

Loading content...

Required methods

pub fn create(self, inner: &Self::In) -> (Self::State, Self::Transfer)[src]

Make a new state and transfer from the input.

This consumes the policy, so non-cloneable items can make their way into the state this way.

Loading content...

Implementors

impl<F: Fn(Transfer::In) -> Transfer::State, Transfer: ScopeTransfer> ScopePolicy for DefaultScopePolicy<F, Transfer>[src]

type In = Transfer::In

type State = Transfer::State

type Transfer = Transfer

Loading content...