Expand description
A simple, single-threaded async runtime for no_std cFS applications.
This module provides an ergonomic runtime that integrates with the cFS
scheduler. The primary entry point is the Runtime struct.
§Usage
The entire application, from initialization to the main processing loops,
can be defined within a single async block.
ⓘ
use leodos_libcfs::join;
use leodos_libcfs::runtime::Runtime;
use leodos_libcfs::cfe::{evs, sb::pipe::Pipe};
async fn task_one(pipe: &Pipe) { /* ... */ }
async fn task_two() { /* ... */ }
#[no_mangle]
pub extern "C" fn CFE_ES_Main() {
Runtime::new().run(async {
evs::event::register(&[]).expect("EVS registration failed");
let pipe = Pipe::new("MY_PIPE", 16).expect("Pipe creation failed");
join!(task_one(&pipe), task_two()).await;
});
}Modules§
- dyn_
scope - A dynamic task scope for managing pinned futures.
- join
- Structured concurrency primitives.
- reactor
- Reactor: a per-task registry of fds waiting for IO.
- scope
- Scope - owns tasks and is itself a Future
- select_
either - A simple implementation of
selectfor futures. - sync
- Synchronization primitives for Leodos LibCFS.
- time
- Asynchronous timer utilities.
Macros§
- pin_mut
- Pins a value on the stack.
- select_
biased - Polls multiple futures and streams simultaneously, executing the branch
for the future that finishes first. Unlike
select!, if multiple futures are ready, one will be selected in order of declaration. Futures directly passed toselect_biased!must beUnpinand implementFusedFuture.
Structs§
- Runtime
- An async runtime designed to integrate with the cFS application lifecycle.
Traits§
- Future
Ext - An extension trait for
Futures that provides a variety of convenient adapters.