Trait freya_native_core::prelude::State  
source · 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 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 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 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
Object Safety§
This trait is not object safe.