Struct NodesState
pub struct NodesState<Key>where
Key: NodeKey,{ /* private fields */ }Expand description
NodesState stores the nodes states given incoming events.
Implementations§
§impl<Key> NodesState<Key>where
Key: NodeKey,
impl<Key> NodesState<Key>where
Key: NodeKey,
pub fn create_update<Name, Source>(
&self,
events_measurer: &impl EventsMeasurer<Key = Key, Name = Name>,
potential_events: &HashMap<Name, Vec<PotentialEvent<Key, Name, Source>>, FxBuildHasher>,
) -> NodesStatesUpdate<Key>where
Name: NameOfEvent,
Source: SourceEvent,
pub fn create_update<Name, Source>(
&self,
events_measurer: &impl EventsMeasurer<Key = Key, Name = Name>,
potential_events: &HashMap<Name, Vec<PotentialEvent<Key, Name, Source>>, FxBuildHasher>,
) -> NodesStatesUpdate<Key>where
Name: NameOfEvent,
Source: SourceEvent,
Create the nodes states given the [PotentialEvent]s.
pub fn apply_update(&mut self, update: NodesStatesUpdate<Key>)
pub fn apply_update(&mut self, update: NodesStatesUpdate<Key>)
Apply the given [NodesStatesUpdate], extending the cached hovered/pressed nodes.
pub fn is_hovered(&self, key: Key) -> bool
pub fn is_pressed(&self, key: Key) -> bool
pub fn is_visible(&self, key: Key) -> bool
pub fn set_visible_nodes(&mut self, visible_nodes: HashSet<Key, FxBuildHasher>)
pub fn set_visible_nodes(&mut self, visible_nodes: HashSet<Key, FxBuildHasher>)
Replace the visible nodes with the result of a new visibility pass.
Trait Implementations§
§impl<Key> Default for NodesState<Key>where
Key: NodeKey,
impl<Key> Default for NodesState<Key>where
Key: NodeKey,
§fn default() -> NodesState<Key>
fn default() -> NodesState<Key>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<Key> Freeze for NodesState<Key>where
Key: Freeze,
impl<Key> RefUnwindSafe for NodesState<Key>where
Key: RefUnwindSafe,
impl<Key> Send for NodesState<Key>where
Key: Send,
impl<Key> Sync for NodesState<Key>where
Key: Sync,
impl<Key> Unpin for NodesState<Key>where
Key: Unpin,
impl<Key> UnsafeUnpin for NodesState<Key>where
Key: UnsafeUnpin,
impl<Key> UnwindSafe for NodesState<Key>where
Key: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more