pub trait Api: Send + 'static {
Show 17 associated items
type Applet: Api;
type Button: Api;
type Clock: Api;
type Crypto: Api;
type Debug: Api;
type Fingerprint: Api;
type Gpio: Api;
type Led: Api;
type Platform: Api;
type Rng: Api;
type Storage: Singleton + Storage + Send;
type Timer: Api;
type Uart: Api;
type Usb: Api;
type Vendor: Api;
// Required methods
fn try_event() -> Option<Event<Self>>;
fn wait_event() -> Event<Self>;
}
Expand description
Board interface.
This is essentially a type hierarchy. The implementation is responsible for handling a possible
explicit global state. The type implementing this API may be equivalent to the never type (e.g.
an empty enum) because it is never used, i.e. there are no functions which take self
.
Required Associated Types§
Sourcetype Fingerprint: Api
Available on crate feature internal-api-fingerprint
only.
type Fingerprint: Api
internal-api-fingerprint
only.Fingerprint interface.
Required Methods§
Sourcefn try_event() -> Option<Event<Self>>
fn try_event() -> Option<Event<Self>>
Returns the oldest triggered event, if any.
This function is non-blocking. See Self::wait_event()
for a blocking version.
Sourcefn wait_event() -> Event<Self>
fn wait_event() -> Event<Self>
Returns the oldest triggered event, possibly waiting until one triggers.
This function is non-blocking if an event already triggered. However, if there are no event available, this function blocks and enters a power-saving state until an event triggers.
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.