pub struct VibeTaskHandle { /* private fields */ }Expand description
Handle returned by VibeEngine::schedule_after / schedule_every / post_with_priority.
Handle returned by every scheduling API.
Cloning is cheap: all clones share the same task state.
Implementations§
Source§impl VibeTaskHandle
impl VibeTaskHandle
Sourcepub fn kind(&self) -> VibeTaskKind
pub fn kind(&self) -> VibeTaskKind
Returns the task kind.
§Returns
A VibeTaskKind describing whether the task is once, delayed, or periodic.
Sourcepub fn priority(&self) -> VibeTaskPriority
pub fn priority(&self) -> VibeTaskPriority
Sourcepub fn state(&self) -> Result<VibeTaskState, VibeEngineError>
pub fn state(&self) -> Result<VibeTaskState, VibeEngineError>
Returns the current task state.
§Returns
Ok(VibeTaskState) or VibeEngineError if scheduler state is poisoned.
Sourcepub fn token(&self) -> VibeCancellationToken
pub fn token(&self) -> VibeCancellationToken
Returns the cancellation token shared with the task.
§Returns
A clone of the task’s VibeCancellationToken.
Sourcepub fn info(&self) -> Result<VibeTaskInfo, VibeEngineError>
pub fn info(&self) -> Result<VibeTaskInfo, VibeEngineError>
Returns a point-in-time snapshot for this task.
§Returns
Ok(VibeTaskInfo) with identifiers, state, and timestamps.
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Trips the cancellation token. The task itself decides when to bail.
Periodic tasks observe the token before scheduling the next iteration
and await callers of VibeTaskHandle::join eventually return
Err(Cancelled).
§Returns
This method returns () after requesting cancellation.
Sourcepub fn is_finished(&self) -> Result<bool, VibeEngineError>
pub fn is_finished(&self) -> Result<bool, VibeEngineError>
Checks whether the task is in a terminal state.
§Returns
Ok(true) for completed, cancelled, or failed tasks.
Sourcepub async fn join(&self) -> Result<(), VibeEngineError>
pub async fn join(&self) -> Result<(), VibeEngineError>
Async join: resolves to Ok(()) on completion, Err(Cancelled) on cancellation,
or Err(InternalError) on panic.
Trait Implementations§
Source§impl Clone for VibeTaskHandle
impl Clone for VibeTaskHandle
Source§fn clone(&self) -> VibeTaskHandle
fn clone(&self) -> VibeTaskHandle
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 VibeTaskHandle
impl RefUnwindSafe for VibeTaskHandle
impl Send for VibeTaskHandle
impl Sync for VibeTaskHandle
impl Unpin for VibeTaskHandle
impl UnsafeUnpin for VibeTaskHandle
impl UnwindSafe for VibeTaskHandle
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