Struct hypetrigger::simple_trigger::SimpleTrigger
source · pub struct SimpleTrigger {
pub callback: Arc<dyn Fn(&Frame) + Send + Sync>,
}
Expand description
A minimal Trigger implementation that just calls a callback on each frame.
Functionally equivalent to a custom struct that implements Trigger
, just
with a callback instead of the on_frame
trait method.
Fields§
§callback: Arc<dyn Fn(&Frame) + Send + Sync>
Implementations§
Trait Implementations§
source§impl Clone for SimpleTrigger
impl Clone for SimpleTrigger
source§fn clone(&self) -> SimpleTrigger
fn clone(&self) -> SimpleTrigger
Returns a copy 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 moresource§impl Trigger for SimpleTrigger
impl Trigger for SimpleTrigger
fn on_frame(&self, frame: &Frame) -> Result<()>
source§fn into_async(self, runner_tx: SyncSender<TriggerCommand>) -> AsyncTriggerwhere
Self: Sized + 'static,
fn into_async(self, runner_tx: SyncSender<TriggerCommand>) -> AsyncTriggerwhere Self: Sized + 'static,
Convert this Trigger into a
AsyncTrigger
, running on a separate thread.Auto Trait Implementations§
impl !RefUnwindSafe for SimpleTrigger
impl Send for SimpleTrigger
impl Sync for SimpleTrigger
impl Unpin for SimpleTrigger
impl !UnwindSafe for SimpleTrigger
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