pub struct VibeCallbackExecutor { /* private fields */ }Expand description
Callback executor returned by VibeEngineExecutor::callback.
Executes user callbacks on the engine callback thread pool.
Use this when an integration receives events on an async/runtime thread but wants user callbacks to run on the configured callback pool.
§Examples
use vibe_ready::{VibeEngine, VibeEngineConfig, VibeResult};
let engine = VibeEngine::create(VibeEngineConfig::builder().build())?;
let callbacks = engine.executor().callback();
callbacks.execute(|| println!("callback ran"));Implementations§
Source§impl VibeCallbackExecutor
impl VibeCallbackExecutor
Sourcepub fn execute<F>(&self, cb: F)
pub fn execute<F>(&self, cb: F)
Executes a zero-argument callback on the callback pool.
§Returns
This method returns () after queuing the callback.
Sourcepub fn once<F, R>(&self, cb: F) -> impl FnOnce(R) + Send + 'static
pub fn once<F, R>(&self, cb: F) -> impl FnOnce(R) + Send + 'static
Converts a one-shot single-argument callback into a pool-dispatched callback.
§Returns
A FnOnce(R) wrapper that moves the argument into the callback pool.
Sourcepub fn once2<F, R1, R2>(&self, cb: F) -> impl FnOnce(R1, R2) + Send + 'static
pub fn once2<F, R1, R2>(&self, cb: F) -> impl FnOnce(R1, R2) + Send + 'static
Converts a one-shot two-argument callback into a pool-dispatched callback.
§Returns
A FnOnce(R1, R2) wrapper that moves both arguments into the callback pool.
Sourcepub fn once3<F, R1, R2, R3>(
&self,
cb: F,
) -> impl FnOnce(R1, R2, R3) + Send + 'static
pub fn once3<F, R1, R2, R3>( &self, cb: F, ) -> impl FnOnce(R1, R2, R3) + Send + 'static
Converts a one-shot three-argument callback into a pool-dispatched callback.
§Returns
A FnOnce(R1, R2, R3) wrapper that moves all arguments into the callback pool.
Sourcepub fn once3_boxed<F, R1, R2, R3>(
&self,
cb: F,
) -> Box<dyn FnOnce(R1, R2, R3) + Send + Sync + 'static>
pub fn once3_boxed<F, R1, R2, R3>( &self, cb: F, ) -> Box<dyn FnOnce(R1, R2, R3) + Send + Sync + 'static>
Returns a boxed one-shot three-argument callback wrapper.
§Returns
A boxed FnOnce that dispatches the original callback on the pool.
Sourcepub fn boxed_fn0<F>(&self, cb: F) -> Box<dyn Fn() + Send + Sync + 'static>
pub fn boxed_fn0<F>(&self, cb: F) -> Box<dyn Fn() + Send + Sync + 'static>
Returns a boxed zero-argument callback wrapper.
§Returns
A boxed Fn that can be cloned or stored by APIs expecting trait objects.
Sourcepub fn boxed_fn<F, R>(&self, cb: F) -> Box<dyn Fn(R) + Send + Sync + 'static>
pub fn boxed_fn<F, R>(&self, cb: F) -> Box<dyn Fn(R) + Send + Sync + 'static>
Returns a boxed one-argument callback wrapper.
§Returns
A boxed Fn(R) that dispatches each invocation on the callback pool.
Sourcepub fn boxed_fn2<F, R1, R2>(
&self,
cb: F,
) -> Box<dyn Fn(R1, R2) + Send + Sync + 'static>
pub fn boxed_fn2<F, R1, R2>( &self, cb: F, ) -> Box<dyn Fn(R1, R2) + Send + Sync + 'static>
Returns a boxed two-argument callback wrapper.
§Returns
A boxed Fn(R1, R2) that dispatches each invocation on the callback pool.
Sourcepub fn fn2<F, R1, R2>(&self, cb: F) -> impl Fn(R1, R2) + Send + Sync + 'static
pub fn fn2<F, R1, R2>(&self, cb: F) -> impl Fn(R1, R2) + Send + Sync + 'static
Returns an unboxed two-argument callback wrapper.
§Returns
An impl Fn(R1, R2) wrapper that dispatches each invocation on the pool.
Sourcepub fn fn2_cloneable<F, R1, R2>(
&self,
cb: F,
) -> impl Fn(R1, R2) + Clone + Send + Sync + 'static
pub fn fn2_cloneable<F, R1, R2>( &self, cb: F, ) -> impl Fn(R1, R2) + Clone + Send + Sync + 'static
Returns a cloneable unboxed two-argument callback wrapper.
§Returns
A cloneable impl Fn(R1, R2) wrapper for APIs that duplicate callbacks.
Sourcepub fn boxed_fn3<F, R1, R2, R3>(
&self,
cb: F,
) -> Box<dyn Fn(R1, R2, R3) + Send + Sync + 'static>
pub fn boxed_fn3<F, R1, R2, R3>( &self, cb: F, ) -> Box<dyn Fn(R1, R2, R3) + Send + Sync + 'static>
Returns a boxed three-argument callback wrapper.
§Returns
A boxed Fn(R1, R2, R3) that dispatches each invocation on the pool.
Sourcepub fn boxed_fn4<F, R1, R2, R3, R4>(
&self,
cb: F,
) -> Box<dyn Fn(R1, R2, R3, R4) + Send + Sync + 'static>
pub fn boxed_fn4<F, R1, R2, R3, R4>( &self, cb: F, ) -> Box<dyn Fn(R1, R2, R3, R4) + Send + Sync + 'static>
Returns a boxed four-argument callback wrapper.
§Returns
A boxed Fn(R1, R2, R3, R4) dispatched on the callback pool.
Sourcepub fn boxed_fn5<F, R1, R2, R3, R4, R5>(
&self,
cb: F,
) -> Box<dyn Fn(R1, R2, R3, R4, R5) + Send + Sync + 'static>
pub fn boxed_fn5<F, R1, R2, R3, R4, R5>( &self, cb: F, ) -> Box<dyn Fn(R1, R2, R3, R4, R5) + Send + Sync + 'static>
Returns a boxed five-argument callback wrapper.
§Returns
A boxed Fn(R1, R2, R3, R4, R5) dispatched on the callback pool.
Sourcepub fn boxed_ref_fn2<F, R1, R2>(
&self,
cb: F,
) -> Box<dyn Fn(&R1, R2) + Send + Sync + 'static>
pub fn boxed_ref_fn2<F, R1, R2>( &self, cb: F, ) -> Box<dyn Fn(&R1, R2) + Send + Sync + 'static>
Returns a boxed callback wrapper that accepts a borrowed first argument.
§Returns
A boxed Fn(&R1, R2) wrapper. The borrowed value is cloned before the
callback is moved to the pool.
Sourcepub fn boxed_str_fn<F>(
&self,
cb: F,
) -> Box<dyn Fn(&str) + Send + Sync + 'static>
pub fn boxed_str_fn<F>( &self, cb: F, ) -> Box<dyn Fn(&str) + Send + Sync + 'static>
Returns a boxed string-slice callback wrapper.
§Returns
A boxed Fn(&str) wrapper that owns the string before dispatching.
Sourcepub fn boxed_str_fn2<F, R2>(
&self,
cb: F,
) -> Box<dyn Fn(&str, R2) + Send + Sync + 'static>
pub fn boxed_str_fn2<F, R2>( &self, cb: F, ) -> Box<dyn Fn(&str, R2) + Send + Sync + 'static>
Returns a boxed &str plus one-argument callback wrapper.
§Returns
A boxed Fn(&str, R2) wrapper that owns the string before dispatching.
Sourcepub fn boxed_str_fn3<F, R2, R3>(
&self,
cb: F,
) -> Box<dyn Fn(&str, R2, R3) + Send + Sync + 'static>
pub fn boxed_str_fn3<F, R2, R3>( &self, cb: F, ) -> Box<dyn Fn(&str, R2, R3) + Send + Sync + 'static>
Returns a boxed &str plus two-argument callback wrapper.
§Returns
A boxed Fn(&str, R2, R3) wrapper that owns the string before dispatching.
Sourcepub fn boxed_str_fn4<F, R2, R3, R4>(
&self,
cb: F,
) -> Box<dyn Fn(&str, R2, R3, R4) + Send + Sync + 'static>
pub fn boxed_str_fn4<F, R2, R3, R4>( &self, cb: F, ) -> Box<dyn Fn(&str, R2, R3, R4) + Send + Sync + 'static>
Returns a boxed &str plus three-argument callback wrapper.
§Returns
A boxed Fn(&str, R2, R3, R4) wrapper that owns the string before dispatching.
Trait Implementations§
Source§impl Clone for VibeCallbackExecutor
impl Clone for VibeCallbackExecutor
Source§fn clone(&self) -> VibeCallbackExecutor
fn clone(&self) -> VibeCallbackExecutor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for VibeCallbackExecutor
impl RefUnwindSafe for VibeCallbackExecutor
impl Send for VibeCallbackExecutor
impl Sync for VibeCallbackExecutor
impl Unpin for VibeCallbackExecutor
impl UnsafeUnpin for VibeCallbackExecutor
impl UnwindSafe for VibeCallbackExecutor
Blanket Implementations§
Source§impl<T> AggregateExpressionMethods for T
impl<T> AggregateExpressionMethods for T
Source§fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
fn aggregate_distinct(self) -> Self::Outputwhere
Self: DistinctDsl,
DISTINCT modifier for aggregate functions Read moreSource§fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
fn aggregate_all(self) -> Self::Outputwhere
Self: AllDsl,
ALL modifier for aggregate functions Read moreSource§fn aggregate_filter<P>(self, f: P) -> Self::Output
fn aggregate_filter<P>(self, f: P) -> Self::Output
Source§fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
fn aggregate_order<O>(self, o: O) -> Self::Outputwhere
Self: OrderAggregateDsl<O>,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
&self to an expression for Diesel’s query builder. Read more