pub struct EventGraph(/* private fields */);Expand description
This manages the graph. The event function is the entrypoint to most graph
interactions.
Implementations§
Source§impl EventGraph
impl EventGraph
pub fn new() -> EventGraph
Sourcepub fn event<R>(
&self,
f: impl FnOnce(&mut ProcessingContext<'_>) -> R,
) -> Option<R>
pub fn event<R>( &self, f: impl FnOnce(&mut ProcessingContext<'_>) -> R, ) -> Option<R>
This is a wrapper that runs the event graph after the callback finishes. You should call this whenever an event happens (user input, remote notification, etc) as well as during initial setup, and do all graph manipulation from within the callback.
If this is called re-entrantly, the latter invocation will be ignored (the
callback) won’t be run and it will return None.
Trait Implementations§
Source§impl Clone for EventGraph
impl Clone for EventGraph
Source§fn clone(&self) -> EventGraph
fn clone(&self) -> EventGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EventGraph
impl !RefUnwindSafe for EventGraph
impl !Send for EventGraph
impl !Sync for EventGraph
impl Unpin for EventGraph
impl !UnwindSafe for EventGraph
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