[][src]Struct ntex_mqtt::v3::client::MqttConnector

pub struct MqttConnector<A, T> { /* fields omitted */ }

Mqtt client connector

Implementations

impl<A> MqttConnector<A, ()> where
    A: Address + Clone
[src]

pub fn new(address: A) -> MqttConnector<A, Connector<A>>[src]

Create new mqtt connector

impl<A, T> MqttConnector<A, T> where
    A: Address + Clone,
    T: Service<Request = Connect<A>, Error = ConnectError>,
    T::Response: AsyncRead + AsyncWrite + Unpin + 'static, 
[src]

pub fn client_id<U>(self, client_id: U) -> Self where
    ByteString: From<U>, 
[src]

Create new client and provide client id

pub fn clean_session(self) -> Self[src]

The handling of the Session state.

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

A time interval measured in seconds.

keep-alive is set to 30 seconds by default.

pub fn last_will(self, val: LastWill) -> Self[src]

Will Message be stored on the Server and associated with the Network Connection.

by default last will value is not set

pub fn username<U>(self, val: U) -> Self where
    ByteString: From<U>, 
[src]

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

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

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

pub fn max_send(self, val: u16) -> Self[src]

Set max send packets number

Number of in-flight outgoing publish packets. By default receive max is set to 16 packets. To disable in-flight limit set value to 0.

pub fn max_receive(self, val: u16) -> Self[src]

Set max receive packets number

Number of in-flight incoming publish packets. By default receive max is set to 16 packets. To disable in-flight limit set value to 0.

pub fn max_packet_size(self, val: u32) -> Self[src]

Max incoming packet size.

To disable max size limit set value to 0.

pub fn packet<F>(self, f: F) -> Self where
    F: FnOnce(&mut Connect), 
[src]

Update connect packet

pub fn handshake_timeout(self, timeout: u16) -> Self[src]

Set handshake timeout in milliseconds.

Handshake includes connect packet and response connect-ack. By default handshake timeuot is disabled.

pub fn disconnect_timeout(self, timeout: u16) -> Self[src]

Set client connection disconnect timeout in milliseconds.

Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the connection get dropped.

To disable timeout set value to 0.

By default disconnect timeout is set to 3 seconds.

pub fn connector<U>(self, connector: U) -> MqttConnector<A, U> where
    U: Service<Request = Connect<A>, Error = ConnectError>,
    U::Response: AsyncRead + AsyncWrite + Unpin + 'static, 
[src]

Use custom connector

pub fn connect(
    &self
) -> impl Future<Output = Result<Client<T::Response>, ClientError>>
[src]

Connect to mqtt server

Auto Trait Implementations

impl<A, T> RefUnwindSafe for MqttConnector<A, T> where
    A: RefUnwindSafe,
    T: RefUnwindSafe
[src]

impl<A, T> Send for MqttConnector<A, T> where
    A: Send,
    T: Send
[src]

impl<A, T> Sync for MqttConnector<A, T> where
    A: Sync,
    T: Sync
[src]

impl<A, T> Unpin for MqttConnector<A, T> where
    A: Unpin,
    T: Unpin
[src]

impl<A, T> UnwindSafe for MqttConnector<A, T> where
    A: UnwindSafe,
    T: UnwindSafe
[src]

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> Instrument for T[src]

impl<T> Instrument 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>,