Skip to main content

Agent

Trait Agent 

Source
pub trait Agent: Send + Sync {
    // Required methods
    fn accept(&self, peer: Address, method: Method) -> BoxFuture<'_, bool>;
    fn display_passkey(&self, peer: Address, passkey: u32) -> BoxFuture<'_, ()>;
    fn request_passkey(&self, peer: Address) -> BoxFuture<'_, Option<u32>>;
    fn confirm_number(&self, peer: Address, number: u32) -> BoxFuture<'_, bool>;
    fn oob_data(&self, peer: Address) -> BoxFuture<'_, Option<OobData>>;
}
Expand description

Answers the questions pairing asks of a person. The bridge implements it over MQTT; tests implement it with fixed answers.

Required Methods§

Source

fn accept(&self, peer: Address, method: Method) -> BoxFuture<'_, bool>

A peer asks to pair with this method; return false to refuse.

Source

fn display_passkey(&self, peer: Address, passkey: u32) -> BoxFuture<'_, ()>

Show this passkey (the peer types it).

Source

fn request_passkey(&self, peer: Address) -> BoxFuture<'_, Option<u32>>

Type the passkey the peer shows; None cancels.

Source

fn confirm_number(&self, peer: Address, number: u32) -> BoxFuture<'_, bool>

Do both devices show this number?

Source

fn oob_data(&self, peer: Address) -> BoxFuture<'_, Option<OobData>>

The peer’s out-of-band data, if any was received.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§