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§
- Fixed
Offset - 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.
- Smol
Join Handler - A spawned task.
- Task
Instance - Public instance of task running.
- Task
Instances Chain - Chain of task run instances. For User access to Running-Task’s instance.
- Tokio
Join Handle - 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§
- Delay
Task Handler - You can implement this trait for your type
T
, and then you can define the function that returns theBox<T> as Box<dyn DelayTaskHandler>
closure, which can be wrapped by the TaskBuilder and then thrown into the time wheel for constant rotation. - Time
Zone - 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>
- Instance
State - State of the task run instance.