Struct meio::handlers::InteractionTask[][src]

pub struct InteractionTask<I: Interaction> { /* fields omitted */ }

Interaction task that can be awaited or aattached to a Context.

Implementations

impl<I: Interaction> InteractionTask<I>[src]

pub async fn recv(self) -> Result<I::Output, Error>[src]

Receive a value

Trait Implementations

impl<I> LiteTask for InteractionTask<I> where
    I: Interaction
[src]

type Output = I::Output

The result of a finished task.

fn interruptable_routine<'async_trait>(
    self
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Routine that can be unconditionally interrupted.

fn name(&self) -> String[src]

Returns unique name of the LiteTask. Uses Uuid by default. Read more

#[must_use]
fn routine<'async_trait>(
    self,
    stop: StopReceiver
) -> Pin<Box<dyn Future<Output = Result<Self::Output, Error>> + Send + 'async_trait>> where
    Self: 'async_trait, 
[src]

Routine of the task that can contain loops. It can taks into accout provided receiver to implement graceful interruption. Read more

#[must_use]
fn repeatable_routine<'life0, 'async_trait>(
    &'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<Self::Output>, Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Routine that will be repeated till fail or success. Read more

fn retry_at(&self, _last_attempt: Instant) -> Instant[src]

When to do the next attempt for repeatable_routine.

fn retry_delay(&self, _last_attempt: Instant) -> Duration[src]

How long to wait to retry. Called by retry_at method.

impl<T, I, M> TaskEliminated<InteractionTask<I>, M> for T where
    T: InteractionDone<I, M>,
    I: Interaction,
    M: Tag
[src]

fn handle<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    _id: IdOf<InteractionTask<I>>,
    tag: M,
    result: Result<I::Output, TaskError>,
    ctx: &'life1 mut Context<Self>
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    'life1: 'async_trait,
    Self: 'async_trait, 
[src]

Called when the Task finished.

Auto Trait Implementations

impl<I> !RefUnwindSafe for InteractionTask<I>

impl<I> Send for InteractionTask<I>

impl<I> !Sync for InteractionTask<I>

impl<I> Unpin for InteractionTask<I> where
    I: Unpin

impl<I> !UnwindSafe for InteractionTask<I>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.