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§
Sourcefn accept(&self, peer: Address, method: Method) -> BoxFuture<'_, bool>
fn accept(&self, peer: Address, method: Method) -> BoxFuture<'_, bool>
A peer asks to pair with this method; return false to refuse.
Sourcefn display_passkey(&self, peer: Address, passkey: u32) -> BoxFuture<'_, ()>
fn display_passkey(&self, peer: Address, passkey: u32) -> BoxFuture<'_, ()>
Show this passkey (the peer types it).
Sourcefn request_passkey(&self, peer: Address) -> BoxFuture<'_, Option<u32>>
fn request_passkey(&self, peer: Address) -> BoxFuture<'_, Option<u32>>
Type the passkey the peer shows; None cancels.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".