Struct homie_device::HomieDeviceBuilder[][src]

pub struct HomieDeviceBuilder { /* fields omitted */ }

Builder for HomieDevice and associated objects.

Implementations

impl HomieDeviceBuilder[src]

pub fn set_firmware(&mut self, firmware_name: &str, firmware_version: &str)[src]

Set the firmware name and version to be advertised for the Homie device.

If this is not set, it will default to the cargo package name and version.

pub fn set_update_callback<F, Fut>(&mut self, update_callback: F) where
    F: FnMut(String, String, String) -> Fut + Send + Sync + 'static,
    Fut: Future<Output = Option<String>> + Send + 'static, 
[src]

pub async fn spawn(
    self
) -> Result<(HomieDevice, impl Future<Output = Result<(), SpawnError>>), ClientError>
[src]

Create a new Homie device, connect to the MQTT broker, and start a task to handle the MQTT connection.

Return value

A pair of the HomieDevice itself, and a Future for the tasks which handle the MQTT connection. You should join on this future to handle any errors it returns.

Trait Implementations

impl Debug for HomieDeviceBuilder[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,