Enable

Trait Enable 

Source
pub trait Enable {
    // Required methods
    fn enabled(&self) -> bool;
    async fn changed(&mut self);
}
Expand description

Whether the receiver should be running, and a way to wait for that to change.

Separate from Power because the two have different owners: the answer comes from PROP_GNSS_ENABLED by way of the device-domain mirror, while the sequencing belongs to the board.

Required Methods§

Source

fn enabled(&self) -> bool

Whether the receiver is wanted right now.

Source

async fn changed(&mut self)

Complete when the answer changes.

Must be cancellation-safe. The pump drops and re-creates this future every time a byte arrives, so an implementation that loses a change it was cancelled on would leave the receiver powered after it was switched off. An embassy_sync::watch::Watch receiver behaves correctly; a bare Signal does not.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§