Module prelude

Source
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::timestamp;
pub use crate::entity::timestamp_micros;
pub use crate::entity::DelayTimer;
pub use crate::entity::DelayTimerBuilder;
pub use crate::timer::task::TaskContext;
pub use crate::timer::task::FrequencyCronStr as 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::status_report::PublicEvent;status-report
pub use cron_clock;
pub use smol::channel;
pub use crate::error::*;

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.
SmolJoinHandler
A spawned task.
TaskInstance
Public instance of task running.
TaskInstancesChain
Chain of task run instances. For User access to Running-Task’s instance.
TokioJoinHandle
An owned permission to join on a task (await its termination).
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_by_smol
Spawns a task onto the global executor (single-threaded by default).
async_spawn_by_tokio
Spawns a new asynchronous task, returning a JoinHandle for it.
sleep_by_tokio
Waits until duration has elapsed.
unblock_spawn_by_smol
Runs blocking code on a thread pool.
unblock_spawn_by_tokio
Runs the provided closure on a thread where blocking is acceptable.

Type Aliases§

AnyResult
Result<T, Error>
InstanceState
State of the task run instance.

Derive Macros§

Error