Skip to main content

canic_core/api/
ready.rs

1//! Module: api::ready
2//!
3//! Responsibility: public readiness facade for endpoint callers.
4//! Does not own: bootstrap state mutation or readiness barrier internals.
5//! Boundary: exposes read-only readiness and bootstrap status snapshots.
6
7use crate::{
8    dto::state::BootstrapStatusResponse,
9    ops::runtime::{bootstrap::BootstrapStatusOps, ready::ReadyOps},
10};
11
12///
13/// ReadyApi
14///
15/// Thin endpoint-facing facade for readiness checks.
16///
17
18pub struct ReadyApi;
19
20impl ReadyApi {
21    /// Return whether Canic runtime invariants have completed restoration.
22    #[must_use]
23    pub fn is_ready() -> bool {
24        ReadyOps::is_ready()
25    }
26
27    /// Return the current bootstrap readiness snapshot.
28    #[must_use]
29    pub fn bootstrap_status() -> BootstrapStatusResponse {
30        BootstrapStatusOps::snapshot()
31    }
32}