pub struct Client { /* private fields */ }
Expand description
Mqtt client
Implementations§
source§impl Client
impl Client
sourcepub fn session_present(&self) -> bool
pub fn session_present(&self) -> bool
Indicates whether there is already stored Session state
sourcepub fn packet(&self) -> &ConnectAck
pub fn packet(&self) -> &ConnectAck
Get reference to ConnectAck
packet
sourcepub fn packet_mut(&mut self) -> &mut ConnectAck
pub fn packet_mut(&mut self) -> &mut ConnectAck
Get mutable reference to ConnectAck
packet
sourcepub fn resource<T, F, U, E>(
self,
address: T,
service: F
) -> ClientRouter<E, U::Error>where
T: IntoPattern,
F: IntoService<U, Publish>,
U: Service<Publish, Response = PublishAck> + 'static,
E: From<U::Error>,
PublishAck: TryFrom<U::Error, Error = E>,
pub fn resource<T, F, U, E>(
self,
address: T,
service: F
) -> ClientRouter<E, U::Error>where
T: IntoPattern,
F: IntoService<U, Publish>,
U: Service<Publish, Response = PublishAck> + 'static,
E: From<U::Error>,
PublishAck: TryFrom<U::Error, Error = E>,
Configure mqtt resource for a specific topic
sourcepub async fn start_default(self)
pub async fn start_default(self)
Run client with default control messages handler.
Default handler closes connection on any control message.
sourcepub async fn start<F, S, E>(self, service: F) -> Result<(), MqttError<E>>where
E: 'static,
F: IntoService<S, ControlMessage<E>> + 'static,
S: Service<ControlMessage<E>, Response = ControlResult, Error = E> + 'static,
pub async fn start<F, S, E>(self, service: F) -> Result<(), MqttError<E>>where
E: 'static,
F: IntoService<S, ControlMessage<E>> + 'static,
S: Service<ControlMessage<E>, Response = ControlResult, Error = E> + 'static,
Run client with provided control messages handler
sourcepub fn into_inner(self) -> (IoBoxed, Codec)
pub fn into_inner(self) -> (IoBoxed, Codec)
Get negotiated io stream and codec