Expand description
Async runtime abstraction traits for Openraft.
This crate provides the core traits for async runtime abstraction, allowing Openraft to work with different async runtimes (tokio, compio, monoio, etc.).
§Key Traits
AsyncRuntime- Main runtime abstractionInstant- Time measurementMpsc,MpscSender,MpscReceiver- Bounded MPSC channelsMutex- Async mutexOneshot,OneshotSender- One-shot channelsWatch,WatchSender,WatchReceiver- Watch channels
§Features
single-threaded- DisablesSend+Syncbounds onOptionalSendandOptionalSync
Re-exports§
pub use instant::Instant;pub use mpsc::Mpsc;pub use mpsc::MpscReceiver;pub use mpsc::MpscSender;pub use mpsc::MpscWeakSender;pub use mpsc::SendError;pub use mpsc::TryRecvError;pub use mutex::Mutex;pub use mutex::OwnedGuard;pub use oneshot::Oneshot;pub use oneshot::OneshotSender;pub use watch::RecvError;pub use watch::Watch;pub use watch::WatchReceiver;pub use watch::WatchSender;
Modules§
- instant
- A trait for time instants.
- mpsc
- Bounded MPSC channel traits.
- mutex
- Async mutex trait.
- oneshot
- Oneshot channel traits.
- testing
- Suite for testing implementations of
AsyncRuntime. - watch
- Watch channel traits.
Traits§
- Async
Runtime - A trait defining interfaces with an asynchronous runtime.
- Optional
Send - A trait that is empty if the
single-threadedfeature flag is enabled, otherwise it extendsSend. - Optional
Sync - A trait that is empty if the
single-threadedfeature flag is enabled, otherwise it extendsSync.
Type Aliases§
- BoxAny
- Type alias for a boxed value that is
Sendand can be any type. - BoxAsync
Once Mut - Type alias for a boxed async function that mutates its argument and is
Send. - BoxFuture
- Type alias for a boxed pinned future that is
Send. - BoxIterator
- Type alias for a boxed iterator that is
Send. - BoxMaybe
Async Once Mut - Type alias for a boxed function that optionally returns an async future.
- BoxOnce
- Type alias for a boxed function that takes an argument and is
Send. - BoxStream
- Type alias for a boxed pinned stream that is
Send.