Module delay_timer::prelude[][src]

Expand description

A “prelude” for users of the delay-timer crate.

This prelude is similar to the standard library’s prelude in that you’ll almost always want to import its entire contents, but unlike the standard library’s prelude you’ll have to do so manually:

use delay_timer::prelude::*;

The prelude may grow over time as additional items see ubiquitous use.

Re-exports

pub use crate::entity::get_timestamp;
pub use crate::entity::get_timestamp_micros;
pub use crate::entity::DelayTimer;
pub use crate::entity::DelayTimerBuilder;
pub use crate::error::*;
pub use crate::macros::*;
pub use crate::timer::task::TaskContext;
pub use crate::timer::task::Frequency;
pub use crate::timer::task::ScheduleIteratorTimeZone;
pub use crate::timer::task::Task;
pub use crate::timer::task::TaskBuilder;
pub use crate::timer::timer_core::FinishOutput;
pub use crate::timer::timer_core::FinishTaskBody;
pub use crate::timer::timer_core::TimerEvent;
pub use crate::utils::convenience::cron_expression_grammatical_candy::CandyCron;
pub use crate::utils::convenience::cron_expression_grammatical_candy::CandyCronStr;
pub use crate::utils::convenience::cron_expression_grammatical_candy::CandyFrequency;
pub use crate::utils::convenience::functions::create_default_delay_task_handler;
pub use crate::utils::convenience::functions::create_delay_task_handler;
pub use crate::utils::convenience::functions::unblock_process_task_fn;
pub use cron_clock;
pub use smol::channel;
pub use crate::utils::convenience::functions::tokio_unblock_process_task_fn;tokio-support
pub use crate::utils::status_report::PublicEvent;

Modules

cron_error
future_lite

Combinators for the Future trait.

instance

State of the task instance.

Macros

anyhow

Construct an ad-hoc error from a string or existing non-anyhow error value.

Structs

FixedOffset

The time zone with fixed offset, from UTC-23:59:59 to UTC+23:59:59.

Instance

instance of task running.

Local

The local timescale. This is implemented via the standard time crate.

TaskInstance

Public instance of task running.

TaskInstancesChain

Chain of task run instances. For User access to Running-Task’s instance.

Utc

The UTC time zone. This is the most efficient time zone when you don’t need the local time. It is also used as an offset (which is also a dummy type).

Traits

DelayTaskHandler

You can implement this trait for your type T, and then you can define the function that returns the Box<T> as Box<dyn DelayTaskHandler> closure, which can be wrapped by the TaskBuilder and then thrown into the time wheel for constant rotation.

TimeZone

The time zone.

Functions

async_spawn

Spawns a task onto the global executor (single-threaded by default).

async_spawn_by_tokiotokio-support

Spawns a new asynchronous task, returning a JoinHandle for it.

sleep_by_tokiotokio-support

Waits until duration has elapsed.

unblock_spawn

Runs blocking code on a thread pool.

unblock_spawn_by_tokiotokio-support

Runs the provided closure on a thread where blocking is acceptable.

Type Definitions

AnyResult

Result<T, Error>

InstanceState

State of the task run instance.

Derive Macros

Error