Skip to main content

ResourceGate

Trait ResourceGate 

Source
pub trait ResourceGate: Sync {
    // Required methods
    fn is_filled(&self) -> bool;
    fn filled_signal(&self) -> &Signal<CriticalSectionRawMutex, ()>;
}
Expand description

Type-erased readiness view of a ResourceSlot, for the supervisor’s bring-up wait.

A TaskNode can gate on any number of slots of different Ts, so the node stores &'static [&'static dyn ResourceGate] (object-safe: no T in the signatures). Same shape as embassy’s dyn driver registries — see https://doc.rust-lang.org/reference/items/traits.html#object-safety. The supervisor only needs “is it filled?” plus the signal to park on; taking the value stays in the generated spawn glue, where the concrete T is known.

Required Methods§

Source

fn is_filled(&self) -> bool

Non-consuming “is the slot currently filled” check.

Source

fn filled_signal(&self) -> &Signal<CriticalSectionRawMutex, ()>

The latching Signal fired by provide/restore, for the supervisor’s bounded pre-spawn wait (see Supervisor::start).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§