Skip to main content

AsyncScHandler

Trait AsyncScHandler 

Source
pub trait AsyncScHandler {
    // Provided methods
    async fn check_in(&self, _exchange: Exchange<'_>) -> Result<(), Error> { ... }
    async fn mcsp_resp(&self, _exchange: Exchange<'_>) -> Result<(), Error> { ... }
}
Expand description

An extension point for the SecureChannel handler, letting a controller react to the Secure Channel messages that the accessory role only drops: incoming Check-In notifications and unsolicited Message Counter Sync responses.

Both methods default to dropping the message (matching the accessory role), so () is a valid no-op handler. A controller overrides the verb(s) it cares about; the handler receives the Exchange to read the message from.

Provided Methods§

Source

async fn check_in(&self, _exchange: Exchange<'_>) -> Result<(), Error>

Handle an incoming Check-In message (Secure Channel opcode CheckIn).

Source

async fn mcsp_resp(&self, _exchange: Exchange<'_>) -> Result<(), Error>

Handle an unsolicited Message Counter Sync response (opcode MsgCounterSyncResp).

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementations on Foreign Types§

Source§

impl AsyncScHandler for ()

Source§

impl<T> AsyncScHandler for &T
where T: AsyncScHandler,

Source§

async fn check_in(&self, exchange: Exchange<'_>) -> Result<(), Error>

Source§

async fn mcsp_resp(&self, exchange: Exchange<'_>) -> Result<(), Error>

Implementors§