pub struct NodesState<Key: NodeKey> { /* private fields */ }
Expand description
NodesState
stores the nodes states given incoming events.
Implementations§
Source§impl<Key: NodeKey> NodesState<Key>
impl<Key: NodeKey> NodesState<Key>
Sourcepub fn create_update<Emmitable: EmmitableEvent<Key = Key, Name = Name>, Name: NameOfEvent, Source: SourceEvent>(
&self,
events_measurer: &impl EventsMeasurer<Key = Key, Name = Name>,
potential_events: &PotentialEvents<Key, Name, Source>,
) -> NodesStatesUpdate<Key>
pub fn create_update<Emmitable: EmmitableEvent<Key = Key, Name = Name>, Name: NameOfEvent, Source: SourceEvent>( &self, events_measurer: &impl EventsMeasurer<Key = Key, Name = Name>, potential_events: &PotentialEvents<Key, Name, Source>, ) -> NodesStatesUpdate<Key>
Create the nodes states given the PotentialEvents.
Sourcepub fn apply_update(&mut self, update: NodesStatesUpdate<Key>)
pub fn apply_update(&mut self, update: NodesStatesUpdate<Key>)
Apply the given NodesStatesUpdate in a way so that only newly hovered/pressed nodes are cached. Any discard of nodes in the NodesStatesUpdate wont matter here.
pub fn is_hovered(&self, key: Key) -> bool
pub fn is_pressed(&self, key: Key) -> bool
Trait Implementations§
Auto Trait Implementations§
impl<Key> Freeze for NodesState<Key>
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> 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