Struct Client

Source
pub struct Client<Io, St> { /* private fields */ }
Expand description

Mqtt client

Implementations§

Source§

impl<Io, St> Client<Io, St>
where St: 'static,

Source

pub fn new(client_id: ByteString) -> Self

Create new client and provide client id

Source

pub fn protocol(self, val: Protocol) -> Self

Mqtt protocol version

Source

pub fn clean_session(self, val: bool) -> Self

The handling of the Session state.

Source

pub fn keep_alive(self, val: u16) -> Self

A time interval measured in seconds.

keep-alive is set to 30 seconds by default.

Source

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

Source

pub fn username(self, val: ByteString) -> Self

Username can be used by the Server for authentication and authorization.

Source

pub fn password(self, val: Bytes) -> Self

Password can be used by the Server for authentication and authorization.

Source

pub fn inflight(self, val: usize) -> Self

Number of in-flight concurrent messages.

in-flight is set to 15 messages

Source

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§

Source§

impl<Io: Clone, St: Clone> Clone for Client<Io, St>

Source§

fn clone(&self) -> Client<Io, St>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl<Io, St> !Freeze for Client<Io, St>

§

impl<Io, St> RefUnwindSafe for Client<Io, St>

§

impl<Io, St> Send for Client<Io, St>
where Io: Send, St: Send,

§

impl<Io, St> Sync for Client<Io, St>
where Io: Sync, St: Sync,

§

impl<Io, St> Unpin for Client<Io, St>
where Io: Unpin, St: Unpin,

§

impl<Io, St> UnwindSafe for Client<Io, St>
where Io: UnwindSafe, St: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.