at
ModuleUndocumented.
Contents
use utopia_schedule::At;Rust
pub struct AtA one-shot trigger: a single occurrence at a fixed moment.
The moment is absolute from construction onward, so "in 30 seconds"
captured through At::after means 30 seconds from when it was
scheduled, not from whenever the scheduler happens to evaluate it. The
scheduler retires it once the occurrence is delivered.
Rust
use php_std::datetime::{DateTime, Timestamp, TzInfo};
use utopia_schedule::{At, Trigger};
let at = |s: &str| DateTime::parse(s.as_bytes(), None, &TzInfo::utc(), Timestamp { sec: 0, usec: 0 }).unwrap();
let delayed = At::after(30, &at("2026-08-17 16:00:00"));
let due = delayed.occurrences_between(&at("2026-08-17 16:00:29"), &at("2026-08-17 16:00:31"));
assert_eq!(due[0].format(b"H:i:s"), b"16:00:30");
assert!(!delayed.recurring());