rusty_rtos_capi_core/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]
2#![forbid(unsafe_code)]
3//! `rusty_rtos-capi-core` — the pure heart of `rusty_rtos-capi`.
4//!
5//! Rules this crate lives by (from the Kairos mission plan):
6//!
7//! 1. `no_std` by default; `alloc` is a feature, never an assumption.
8//! 2. No CPU, no registers, no allocator, no operating system. Ports and
9//! backends are separate WRAP crates.
10//! 3. Every type that crosses to another Kairos package comes from
11//! `rusty_rtos_core`, so packages compose without conversions.
12//! 4. Handles are indices, never pointers; nothing on a hot path allocates.
13//! 5. `forbid(unsafe)`. The C kernel's trace is the oracle; the scalar path
14//! is the oracle; any faster path is gated identical against it.
15
16#[cfg(feature = "alloc")]
17extern crate alloc;
18
19pub use rusty_rtos_core as rtos_core;
20
21pub mod codec;
22pub mod cstr;
23pub mod ctypes;
24pub mod retry;
25pub mod symbols;
26
27/// The names a firmware wants in scope.
28pub mod prelude {
29 pub use crate::codec::{handle_from_c, handle_to_c, item_from_bytes, item_to_bytes};
30 pub use crate::ctypes::{
31 BaseType_t, CopyPosition, ERR_QUEUE_FULL, PD_FAIL, PD_PASS, StackDepth_t, TickType_t,
32 UBaseType_t, pd,
33 };
34 pub use crate::retry::{Blocked, SpinGuard, on_blocked};
35 pub use rusty_rtos_core::prelude::*;
36}
37
38/// Crate version, for manifests and logs.
39pub const VERSION: &str = env!("CARGO_PKG_VERSION");