pub struct Client<Io, St> { /* private fields */ }
Expand description
Mqtt client
Implementations§
Source§impl<Io, St> Client<Io, St>where
St: 'static,
impl<Io, St> Client<Io, St>where
St: 'static,
Sourcepub fn new(client_id: ByteString) -> Self
pub fn new(client_id: ByteString) -> Self
Create new client and provide client id
Sourcepub fn clean_session(self, val: bool) -> Self
pub fn clean_session(self, val: bool) -> Self
The handling of the Session state.
Sourcepub fn keep_alive(self, val: u16) -> Self
pub fn keep_alive(self, val: u16) -> Self
A time interval measured in seconds.
keep-alive is set to 30 seconds by default.
Sourcepub fn last_will(self, val: LastWill) -> Self
pub fn last_will(self, val: LastWill) -> Self
Will Message be stored on the Server and associated with the Network Connection.
by default last will value is not set
Sourcepub fn username(self, val: ByteString) -> Self
pub fn username(self, val: ByteString) -> Self
Username can be used by the Server for authentication and authorization.
Sourcepub fn password(self, val: Bytes) -> Self
pub fn password(self, val: Bytes) -> Self
Password can be used by the Server for authentication and authorization.
Sourcepub fn inflight(self, val: usize) -> Self
pub fn inflight(self, val: usize) -> Self
Number of in-flight concurrent messages.
in-flight is set to 15 messages
Sourcepub fn state<C, F>(self, state: F) -> ServiceBuilder<Io, St, C>where
F: IntoService<C>,
Io: AsyncRead + AsyncWrite,
C: Service<Request = ConnectAck<Io>, Response = ConnectAckResult<Io, St>>,
C::Error: 'static,
pub fn state<C, F>(self, state: F) -> ServiceBuilder<Io, St, C>where
F: IntoService<C>,
Io: AsyncRead + AsyncWrite,
C: Service<Request = ConnectAck<Io>, Response = ConnectAckResult<Io, St>>,
C::Error: 'static,
Set state service
State service verifies connect ack packet and construct connection state.
Trait Implementations§
Auto Trait Implementations§
impl<Io, St> !Freeze for Client<Io, St>
impl<Io, St> RefUnwindSafe for Client<Io, St>where
Io: RefUnwindSafe,
St: RefUnwindSafe,
impl<Io, St> Send for Client<Io, St>
impl<Io, St> Sync for Client<Io, St>
impl<Io, St> Unpin for Client<Io, St>
impl<Io, St> UnwindSafe for Client<Io, St>where
Io: UnwindSafe,
St: UnwindSafe,
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