Struct ntex_mqtt::v5::client::MqttConnector [−][src]
Mqtt client connector
Implementations
impl<A> MqttConnector<A, ()> where
A: Address + Clone,
[src]
A: Address + Clone,
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]
A: Address + Clone,
T: Service<Request = Connect<A>, Error = ConnectError>,
T::Response: AsyncRead + AsyncWrite + Unpin + 'static,
pub fn client_id<U>(self, client_id: U) -> Self where
ByteString: From<U>,
[src]
ByteString: From<U>,
Create new client and provide client id
pub fn clean_start(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 auth(self, method: ByteString, data: Bytes) -> Self
[src]
Set auth-method and auth-data for connect packet.
pub fn username(self, val: ByteString) -> Self
[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_packet_size(self, val: u32) -> Self
[src]
Max incoming packet size.
To disable max size limit set value to 0.
pub fn receive_max(self, val: u16) -> Self
[src]
Set receive max
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 properties<F>(self, f: F) -> Self where
F: FnOnce(&mut UserProperties),
[src]
F: FnOnce(&mut UserProperties),
Update connect user properties
pub fn packet<F>(self, f: F) -> Self where
F: FnOnce(&mut Connect),
[src]
F: FnOnce(&mut Connect),
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]
U: Service<Request = Connect<A>, Error = ConnectError>,
U::Response: AsyncRead + AsyncWrite + Unpin + 'static,
Use custom connector
pub fn connect(
&self
) -> impl Future<Output = Result<Client<T::Response>, ClientError>>
[src]
&self
) -> impl Future<Output = Result<Client<T::Response>, ClientError>>
Connect to mqtt server
Auto Trait Implementations
impl<A, T> !RefUnwindSafe for MqttConnector<A, T>
impl<A, T> !Send for MqttConnector<A, T>
impl<A, T> !Sync for MqttConnector<A, T>
impl<A, T> Unpin for MqttConnector<A, T> where
A: Unpin,
T: Unpin,
A: Unpin,
T: Unpin,
impl<A, T> !UnwindSafe for MqttConnector<A, T>
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> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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>,