Skip to main content

Crate leodos_libcfs

Crate leodos_libcfs 

Source
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::App builder) 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_std cFS 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 CfsAllocator as the crate’s #[global_allocator].
try_join
Polls futures concurrently, returning Ok(tuple) when all complete successfully, or the first Err encountered.
warn
Sends a warning EVS event (EventType::Error — non-catastrophic).