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]
F: FnMut(String, String, String) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Option<String>> + Send + 'static,
pub async fn spawn(
self
) -> Result<(HomieDevice, impl Future<Output = Result<(), SpawnError>>), ClientError>
[src]
self
) -> Result<(HomieDevice, impl Future<Output = Result<(), SpawnError>>), ClientError>
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
Auto Trait Implementations
impl !RefUnwindSafe for HomieDeviceBuilder
impl Send for HomieDeviceBuilder
impl Sync for HomieDeviceBuilder
impl Unpin for HomieDeviceBuilder
impl !UnwindSafe for HomieDeviceBuilder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,