Skip to main content

require_lifecycle

Macro require_lifecycle 

Source
macro_rules! require_lifecycle {
    ($phase:expr) => { ... };
}
Expand description

Compile-time assert that the backend in this binary delivers $phase, else a build error. Use it to make a hard dependency on a platform-specific phase explicit: day::require_lifecycle!(day::Lifecycle::DidEnterBackground); fails to compile on desktop. For soft handling, guard with lifecycle::supported / lifecycle_supported instead.

Day API ↩ Guides· daybrite.dev