ic-timers 0.4.0

Observable and recovery-aware timers for Internet Computer canisters
Documentation
//! Observable and recovery-aware timer primitives for Internet Computer
//! canisters.
//!
//! `ic-timers` is a higher-level wrapper around `ic-cdk-timers`, which remains
//! the provider that arms and clears platform timers. This crate adds
//! bounded coordination, scheduling, and observation above it.
//!
//! The runtime executes `Once`, after-completion, and pre-armed synchronous
//! watchdog callbacks through one volatile canister-local registry.
//! Consumers retain durable application authority and synchronously reconstruct
//! retained registrations during their existing lifecycle hooks. Transient
//! remove-on-stop callbacks use direct registration. Registration capabilities
//! can observe exact armed provider-wakeup ownership without making snapshots
//! or observations into scheduling authority.

#![forbid(unsafe_code)]
#![deny(rustdoc::broken_intra_doc_links)]

mod control;
mod platform;
mod registry;
mod runtime;
mod schedule;
mod snapshot;

pub use registry::{MAX_TIMER_REGISTRATIONS, RegisterError};
pub use runtime::{
    AfterCompletionRegistration, OnceRegistration, TimerContext, TimerError, TimerReconcileState,
    WatchdogRegistration, consecutive_expected_failures, initialize_runtime,
    reconcile_after_completion, reconcile_once, reconcile_watchdog, register_after_completion,
    register_once, register_watchdog, timer_snapshot, timer_snapshots,
};
pub use schedule::{ScheduleError, TimerCadence, TimerDirective, TimerSchedule};
pub use snapshot::{
    DeclarationLifetime, InactiveReason, MAX_TIMER_IDENTITY_COMPONENT_BYTES, MeasurementSummary,
    OrdinaryRuntimeStateSnapshot, TimerCompletion, TimerCompletionOutcome, TimerControlFailure,
    TimerCounters, TimerDirectiveSnapshot, TimerEpoch, TimerIdentity, TimerIdentityError,
    TimerIdentityField, TimerLastOutcome, TimerObservabilitySnapshot, TimerOutcomeSnapshot,
    TimerPerformance, TimerPolicy, TimerProcessCondition, TimerRegistrationStatus, TimerRunResult,
    TimerRuntimeStateSnapshot, TimerSchedulingMode, TimerSnapshot, WatchdogAttemptSnapshot,
    WatchdogAttemptStatus, WatchdogDecision, WatchdogRunResult, WatchdogRuntimeStateSnapshot,
};