Struct meio::task::HeartBeat[][src]

pub struct HeartBeat { /* fields omitted */ }

The lite task that sends ticks to a Recipient.

Implementations

impl HeartBeat[src]

pub fn new<T>(duration: Duration, address: Address<T>) -> Self where
    T: Actor + ActionHandler<Tick>, 
[src]

Creates a new HeartBeat lite task.

Trait Implementations

impl Debug for HeartBeat[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl LiteTask for HeartBeat[src]

type Output = ()

The result of a finished task.

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_delay(&self, _last_attempt: Instant) -> Duration[src]

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

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 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 retry_at(&self, _last_attempt: Instant) -> Instant[src]

When to do the next attempt for repeatable_routine.

impl<T> TaskEliminated<HeartBeat, ()> for T where
    T: OnTick
[src]

fn handle<'life0, 'life1, 'async_trait>(
    &'life0 mut self,
    _id: IdOf<HeartBeat>,
    _tag: (),
    _result: Result<(), 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

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.