Skip to main content

VibeCallbackExecutor

Struct VibeCallbackExecutor 

Source
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

Source

pub fn execute<F>(&self, cb: F)
where F: FnOnce() + Send + 'static,

Executes a zero-argument callback on the callback pool.

§Returns

This method returns () after queuing the callback.

Source

pub fn once<F, R>(&self, cb: F) -> impl FnOnce(R) + Send + 'static
where F: FnOnce(R) + Send + 'static, 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.

Source

pub fn once2<F, R1, R2>(&self, cb: F) -> impl FnOnce(R1, R2) + Send + 'static
where F: FnOnce(R1, R2) + Send + 'static, R1: Send + 'static, 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.

Source

pub fn once3<F, R1, R2, R3>( &self, cb: F, ) -> impl FnOnce(R1, R2, R3) + Send + 'static
where F: FnOnce(R1, R2, R3) + Send + 'static, R1: Send + 'static, R2: Send + 'static, 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.

Source

pub fn once3_boxed<F, R1, R2, R3>( &self, cb: F, ) -> Box<dyn FnOnce(R1, R2, R3) + Send + Sync + 'static>
where F: FnOnce(R1, R2, R3) + Send + Sync + 'static, R1: Send + 'static, R2: Send + 'static, R3: Send + 'static,

Returns a boxed one-shot three-argument callback wrapper.

§Returns

A boxed FnOnce that dispatches the original callback on the pool.

Source

pub fn boxed_fn0<F>(&self, cb: F) -> Box<dyn Fn() + Send + Sync + 'static>
where F: 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.

Source

pub fn boxed_fn<F, R>(&self, cb: F) -> Box<dyn Fn(R) + Send + Sync + 'static>
where F: Fn(R) + Send + Sync + 'static, R: Send + 'static,

Returns a boxed one-argument callback wrapper.

§Returns

A boxed Fn(R) that dispatches each invocation on the callback pool.

Source

pub fn boxed_fn2<F, R1, R2>( &self, cb: F, ) -> Box<dyn Fn(R1, R2) + Send + Sync + 'static>
where F: Fn(R1, R2) + Send + Sync + 'static, R1: Send + 'static, R2: Send + 'static,

Returns a boxed two-argument callback wrapper.

§Returns

A boxed Fn(R1, R2) that dispatches each invocation on the callback pool.

Source

pub fn fn2<F, R1, R2>(&self, cb: F) -> impl Fn(R1, R2) + Send + Sync + 'static
where F: Fn(R1, R2) + Send + Sync + 'static, R1: Send + 'static, R2: Send + 'static,

Returns an unboxed two-argument callback wrapper.

§Returns

An impl Fn(R1, R2) wrapper that dispatches each invocation on the pool.

Source

pub fn fn2_cloneable<F, R1, R2>( &self, cb: F, ) -> impl Fn(R1, R2) + Clone + Send + Sync + 'static
where F: Fn(R1, R2) + Clone + Send + Sync + 'static, R1: Send + 'static, R2: Send + 'static,

Returns a cloneable unboxed two-argument callback wrapper.

§Returns

A cloneable impl Fn(R1, R2) wrapper for APIs that duplicate callbacks.

Source

pub fn boxed_fn3<F, R1, R2, R3>( &self, cb: F, ) -> Box<dyn Fn(R1, R2, R3) + Send + Sync + 'static>
where F: Fn(R1, R2, R3) + Send + Sync + 'static, R1: Send + 'static, R2: Send + 'static, R3: Send + 'static,

Returns a boxed three-argument callback wrapper.

§Returns

A boxed Fn(R1, R2, R3) that dispatches each invocation on the pool.

Source

pub fn boxed_fn4<F, R1, R2, R3, R4>( &self, cb: F, ) -> Box<dyn Fn(R1, R2, R3, R4) + Send + Sync + 'static>
where F: Fn(R1, R2, R3, R4) + Send + Sync + 'static, R1: Send + 'static, R2: Send + 'static, R3: Send + 'static, R4: Send + 'static,

Returns a boxed four-argument callback wrapper.

§Returns

A boxed Fn(R1, R2, R3, R4) dispatched on the callback pool.

Source

pub fn boxed_fn5<F, R1, R2, R3, R4, R5>( &self, cb: F, ) -> Box<dyn Fn(R1, R2, R3, R4, R5) + Send + Sync + 'static>
where F: Fn(R1, R2, R3, R4, R5) + Send + Sync + 'static, R1: Send + 'static, R2: Send + 'static, R3: Send + 'static, R4: Send + 'static, R5: Send + 'static,

Returns a boxed five-argument callback wrapper.

§Returns

A boxed Fn(R1, R2, R3, R4, R5) dispatched on the callback pool.

Source

pub fn boxed_ref_fn2<F, R1, R2>( &self, cb: F, ) -> Box<dyn Fn(&R1, R2) + Send + Sync + 'static>
where F: Fn(&R1, R2) + Send + Sync + 'static, R1: Clone + Send + 'static, R2: Send + '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.

Source

pub fn boxed_str_fn<F>( &self, cb: F, ) -> Box<dyn Fn(&str) + Send + Sync + 'static>
where F: Fn(&str) + Send + Sync + 'static,

Returns a boxed string-slice callback wrapper.

§Returns

A boxed Fn(&str) wrapper that owns the string before dispatching.

Source

pub fn boxed_str_fn2<F, R2>( &self, cb: F, ) -> Box<dyn Fn(&str, R2) + Send + Sync + 'static>
where F: Fn(&str, R2) + Send + Sync + 'static, R2: Send + 'static,

Returns a boxed &str plus one-argument callback wrapper.

§Returns

A boxed Fn(&str, R2) wrapper that owns the string before dispatching.

Source

pub fn boxed_str_fn3<F, R2, R3>( &self, cb: F, ) -> Box<dyn Fn(&str, R2, R3) + Send + Sync + 'static>
where F: Fn(&str, R2, R3) + Send + Sync + 'static, R2: Send + 'static, R3: Send + 'static,

Returns a boxed &str plus two-argument callback wrapper.

§Returns

A boxed Fn(&str, R2, R3) wrapper that owns the string before dispatching.

Source

pub fn boxed_str_fn4<F, R2, R3, R4>( &self, cb: F, ) -> Box<dyn Fn(&str, R2, R3, R4) + Send + Sync + 'static>
where F: Fn(&str, R2, R3, R4) + Send + Sync + 'static, R2: Send + 'static, R3: Send + 'static, R4: Send + '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.

Source

pub fn boxed_str_str4_fn<F, R2, R3>( &self, cb: F, ) -> Box<dyn Fn(&str, R2, R3, &str) + Send + Sync + 'static>
where F: Fn(&str, R2, R3, &str) + Send + Sync + 'static, R2: Send + 'static, R3: Send + 'static,

Returns a boxed callback wrapper with first and fourth string arguments.

§Returns

A boxed Fn(&str, R2, R3, &str) wrapper that owns both string slices before dispatching.

Trait Implementations§

Source§

impl Clone for VibeCallbackExecutor

Source§

fn clone(&self) -> VibeCallbackExecutor

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AggregateExpressionMethods for T

Source§

fn aggregate_distinct(self) -> Self::Output
where Self: DistinctDsl,

DISTINCT modifier for aggregate functions Read more
Source§

fn aggregate_all(self) -> Self::Output
where Self: AllDsl,

ALL modifier for aggregate functions Read more
Source§

fn aggregate_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add an aggregate function filter Read more
Source§

fn aggregate_order<O>(self, o: O) -> Self::Output
where Self: OrderAggregateDsl<O>,

Add an aggregate function order Read more
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Converts 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>

Converts 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)

Converts &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)

Converts &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
where T: Any + Send,

Source§

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoSql for T

Source§

fn into_sql<T>(self) -> Self::Expression

Convert self to an expression for Diesel’s query builder. Read more
Source§

fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
where &'a Self: AsExpression<T>, T: SqlType + TypedExpressionType,

Convert &self to an expression for Diesel’s query builder. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WindowExpressionMethods for T

Source§

fn over(self) -> Self::Output
where Self: OverDsl,

Turn a function call into a window function call Read more
Source§

fn window_filter<P>(self, f: P) -> Self::Output
where P: AsExpression<Bool>, Self: FilterDsl<<P as AsExpression<Bool>>::Expression>,

Add a filter to the current window function Read more
Source§

fn partition_by<E>(self, expr: E) -> Self::Output
where Self: PartitionByDsl<E>,

Add a partition clause to the current window function Read more
Source§

fn window_order<E>(self, expr: E) -> Self::Output
where Self: OrderWindowDsl<E>,

Add a order clause to the current window function Read more
Source§

fn frame_by<E>(self, expr: E) -> Self::Output
where Self: FrameDsl<E>,

Add a frame clause to the current window function Read more