pub trait State<V: FromAnyValue + Send + Sync = ()>:
Any
+ Send
+ Sync {
type ParentDependencies: Dependancy;
type ChildDependencies: Dependancy;
type NodeDependencies: Dependancy;
const NODE_MASK: NodeMaskBuilder<'static>;
const TRAVERSE_SHADOW_DOM: bool = false;
// Required methods
fn update<'a>(
&mut self,
node_view: NodeView<'_, V>,
node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>,
parent: Option<<Self::ParentDependencies as Dependancy>::ElementBorrowed<'a>>,
children: Vec<<Self::ChildDependencies as Dependancy>::ElementBorrowed<'a>>,
context: &SendAnyMap,
) -> bool;
fn create<'a>(
node_view: NodeView<'_, V>,
node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>,
parent: Option<<Self::ParentDependencies as Dependancy>::ElementBorrowed<'a>>,
children: Vec<<Self::ChildDependencies as Dependancy>::ElementBorrowed<'a>>,
context: &SendAnyMap,
) -> Self;
fn workload_system(
type_id: TypeId,
dependants: Arc<Dependants>,
pass_direction: PassDirection,
) -> WorkloadSystem;
// Provided method
fn to_type_erased() -> TypeErasedState<V>
where Self: Sized { ... }
}
Expand description
A state that is automatically inserted in a node with dependencies.
Required Associated Constants§
Sourceconst NODE_MASK: NodeMaskBuilder<'static>
const NODE_MASK: NodeMaskBuilder<'static>
This is a mask of what aspects of the node are required to update this state
Provided Associated Constants§
Sourceconst TRAVERSE_SHADOW_DOM: bool = false
const TRAVERSE_SHADOW_DOM: bool = false
Does the state traverse into the shadow dom or pass over it. This should be true for layout and false for styles
Required Associated Types§
Sourcetype ParentDependencies: Dependancy
type ParentDependencies: Dependancy
This is a tuple of (T: State, ..) of states read from the parent required to update this state
Sourcetype ChildDependencies: Dependancy
type ChildDependencies: Dependancy
This is a tuple of (T: State, ..) of states read from the children required to update this state
Sourcetype NodeDependencies: Dependancy
type NodeDependencies: Dependancy
This is a tuple of (T: State, ..) of states read from the node required to update this state
Required Methods§
Sourcefn update<'a>(
&mut self,
node_view: NodeView<'_, V>,
node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>,
parent: Option<<Self::ParentDependencies as Dependancy>::ElementBorrowed<'a>>,
children: Vec<<Self::ChildDependencies as Dependancy>::ElementBorrowed<'a>>,
context: &SendAnyMap,
) -> bool
fn update<'a>( &mut self, node_view: NodeView<'_, V>, node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>, parent: Option<<Self::ParentDependencies as Dependancy>::ElementBorrowed<'a>>, children: Vec<<Self::ChildDependencies as Dependancy>::ElementBorrowed<'a>>, context: &SendAnyMap, ) -> bool
Update this state in a node, returns if the state was updated
Sourcefn create<'a>(
node_view: NodeView<'_, V>,
node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>,
parent: Option<<Self::ParentDependencies as Dependancy>::ElementBorrowed<'a>>,
children: Vec<<Self::ChildDependencies as Dependancy>::ElementBorrowed<'a>>,
context: &SendAnyMap,
) -> Self
fn create<'a>( node_view: NodeView<'_, V>, node: <Self::NodeDependencies as Dependancy>::ElementBorrowed<'a>, parent: Option<<Self::ParentDependencies as Dependancy>::ElementBorrowed<'a>>, children: Vec<<Self::ChildDependencies as Dependancy>::ElementBorrowed<'a>>, context: &SendAnyMap, ) -> Self
Create a new instance of this state
Sourcefn workload_system(
type_id: TypeId,
dependants: Arc<Dependants>,
pass_direction: PassDirection,
) -> WorkloadSystem
fn workload_system( type_id: TypeId, dependants: Arc<Dependants>, pass_direction: PassDirection, ) -> WorkloadSystem
Create a workload system for this state
Provided Methods§
Sourcefn to_type_erased() -> TypeErasedState<V>where
Self: Sized,
fn to_type_erased() -> TypeErasedState<V>where
Self: Sized,
Converts to a type erased version of the trait
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.