pub trait OsInterface:
Send
+ Sync
+ Sized
+ 'static {
type RawMutex: ConstInit + RawMutex;
type Notifier: NotifierInterface;
type NotifyWaiter: NotifyWaiterInterface<Self>;
type Instant: TickInstant;
type Delay: DelayNs;
const O: Self;
// Required methods
fn yield_thread();
fn delay() -> Self::Delay;
fn notify() -> (Self::Notifier, Self::NotifyWaiter);
// Provided methods
fn yield_task() { ... }
fn mutex<T>(d: T) -> Mutex<Self, T> { ... }
}Expand description
The interface for different operating systems.
We use the mutex-traits crate to provide mutex functionality.
You can implement your own mutex by implementing the RawMutex trait from the mutex-traits crate.
Required Associated Constants§
Required Associated Types§
type RawMutex: ConstInit + RawMutex
type Notifier: NotifierInterface
type NotifyWaiter: NotifyWaiterInterface<Self>
type Instant: TickInstant
type Delay: DelayNs
Required Methods§
fn yield_thread()
fn delay() -> Self::Delay
fn notify() -> (Self::Notifier, Self::NotifyWaiter)
Provided Methods§
fn yield_task()
fn mutex<T>(d: T) -> Mutex<Self, T>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
Source§impl OsInterface for FakeOs
impl OsInterface for FakeOs
const O: Self
type RawMutex = FakeRawMutex
type Notifier = FakeNotifier
type NotifyWaiter = FakeNotifier
type Instant = FakeTickInstant
type Delay = TickDelay<FakeTickInstant>
Source§impl OsInterface for StdOs
Available on crate feature std only.
impl OsInterface for StdOs
Available on crate feature
std only.