pub struct Bridge { /* private fields */ }Expand description
Bridge state between events.
Implementations§
Source§impl Bridge
impl Bridge
Sourcepub fn new(host: Host<AnyAdapter>, mqtt: Mqtt, config: Config) -> Bridge
pub fn new(host: Host<AnyAdapter>, mqtt: Mqtt, config: Config) -> Bridge
A bridge over a running host and an MQTT session.
Sourcepub async fn on_connected(&mut self)
pub async fn on_connected(&mut self)
Everything a fresh MQTT session needs: subscriptions, availability, retained info, devices and discovery.
Sourcepub async fn on_host_event(&mut self, event: HostEvent)
pub async fn on_host_event(&mut self, event: HostEvent)
Handle one host event.
Sourcepub async fn on_message(&mut self, topic: &str, payload: &[u8])
pub async fn on_message(&mut self, topic: &str, payload: &[u8])
Handle one MQTT message.
Auto Trait Implementations§
impl !RefUnwindSafe for Bridge
impl !UnwindSafe for Bridge
impl Freeze for Bridge
impl Send for Bridge
impl Sync for Bridge
impl Unpin for Bridge
impl UnsafeUnpin for Bridge
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more