Skip to main content

appcore_core/
context.rs

1// =============================================================================
2//        #######
3//     ###       ###     F: context.rs
4//    ##   ## ##   ##    P: AppCore-Runtime
5//         ## ##
6//                       C: 2026/05/29 20:47:35 by dnettoRaw
7//    ##   ## ##   ##    U: 2026/07/23 23:50:45 by dnettoRaw
8//      ###########      S: 1.0.1-rc.8
9// =============================================================================
10
11//! Runtime context contract available to runtime components.
12
13use crate::ids::{AppFamily, AppId, NodeId, RuntimeContractVersion, SyncGroup};
14
15/// Minimal read-only runtime context contract.
16pub trait RuntimeContext: Send + Sync {
17    /// Returns the hosted application identity.
18    fn app_id(&self) -> &AppId;
19    /// Returns the application compatibility family.
20    fn app_family(&self) -> &AppFamily;
21    /// Returns the synchronization isolation group.
22    fn sync_group(&self) -> &SyncGroup;
23    /// Returns the Runtime contract version.
24    fn runtime_contract(&self) -> RuntimeContractVersion;
25    /// Returns the current node identity.
26    fn node_id(&self) -> &NodeId;
27}