Expand description
§leodos-libcfs: A Safe Rust Wrapper for the Core Flight System
leodos-libcfs provides safe, idiomatic, and zero-cost wrappers around the C APIs of the
NASA Core Flight System (cFS), including the Core Flight Executive (CFE),
Operating System Abstraction Layer (OSAL), and Platform Support Package (PSP).
This crate is designed to enable the development of cFS applications in Rust with a high degree of safety and ergonomics, leveraging Rust’s ownership, borrowing, and type system to prevent common errors found in C-based cFS development.
§Key Features
- Safe Abstractions: RAII guards for resource management (e.g.,
Pipe,Table,Mutex), preventing resource leaks. - Type Safety: Generic wrappers for message passing (
Queue<T>), tables (Table<T>), and critical data stores (CdsBlock<T>) ensure data integrity at compile time. - Ergonomic API: A high-level application framework (
app::Appbuilder) simplifies the boilerplate of a cFS application. - Comprehensive Coverage: Wrappers for major cFE services (ES, EVS, SB, TBL, TIME) and key OSAL/PSP functionalities.
Re-exports§
pub use util::cstring;pub use util::string_from_c_buf;
Modules§
- app
- Standard cFS application scaffolding.
- cell
- Single-task cell for static storage.
- cfe
- CFE (Core Flight Executive) interface for CFS.
- error
- Error types for cFS.
- log
- Safe, ergonomic logging facilities for cFS.
- macros
- Various macros used throughout libcfs.
- os
- OSAL (Operating System Abstraction Layer) interface.
- psp
- CFE Platform Support Package (PSP) interface.
- runtime
- A simple, single-threaded async runtime for
no_stdcFS applications. - status
- CFE informational status code handling.
- util
- General utility functions.
Macros§
- comptime_
assert_ align_ le - Asserts at compile-time that
align_of::<T>() <= limit. Works inside generic functions with const generics. - comptime_
assert_ size_ le - Asserts at compile-time that
size_of::<T>() <= limit. Works inside generic functions with const generics. - err
- Sends a critical EVS event (
EventType::Critical). - info
- Sends an informational EVS event (
EventType::Info). - join
- Polls futures concurrently, returning a tuple of all outputs when every future has completed.
- log
- A macro to write a formatted string to the cFE System Log.
- printf
- A macro to write a formatted string to the OSAL console (
OS_printf). - register_
allocator - Declares
CfsAllocatoras the crate’s#[global_allocator]. - try_
join - Polls futures concurrently, returning
Ok(tuple)when all complete successfully, or the firstErrencountered. - warn
- Sends a warning EVS event (
EventType::Error— non-catastrophic).