Struct ntex_mqtt::v3::MqttConnector
source · [−]pub struct MqttConnector<A, T> { /* private fields */ }
Expand description
Mqtt client connector
Implementations
sourceimpl<A> MqttConnector<A, ()> where
A: Address + Clone,
impl<A> MqttConnector<A, ()> where
A: Address + Clone,
sourcepub fn new(address: A) -> MqttConnector<A, Connector<A>>
pub fn new(address: A) -> MqttConnector<A, Connector<A>>
Create new mqtt connector
sourceimpl<A, T> MqttConnector<A, T> where
A: Address + Clone,
impl<A, T> MqttConnector<A, T> where
A: Address + Clone,
sourcepub fn client_id<U>(self, client_id: U) -> Self where
ByteString: From<U>,
pub fn client_id<U>(self, client_id: U) -> Self where
ByteString: From<U>,
Create new client and provide client id
sourcepub fn clean_session(self) -> Self
pub fn clean_session(self) -> Self
The handling of the Session state.
sourcepub fn keep_alive(self, val: Seconds) -> Self
pub fn keep_alive(self, val: Seconds) -> 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<U>(self, val: U) -> Self where
ByteString: From<U>,
pub fn username<U>(self, val: U) -> Self where
ByteString: From<U>,
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 max_send(self, val: u16) -> Self
pub fn max_send(self, val: u16) -> Self
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.
sourcepub fn max_receive(self, val: u16) -> Self
pub fn max_receive(self, val: u16) -> Self
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.
sourcepub fn max_packet_size(self, val: u32) -> Self
pub fn max_packet_size(self, val: u32) -> Self
Max incoming packet size.
To disable max size limit set value to 0.
sourcepub fn handshake_timeout(self, timeout: Seconds) -> Self
pub fn handshake_timeout(self, timeout: Seconds) -> Self
Set handshake timeout.
Handshake includes connect
packet and response connect-ack
.
By default handshake timeuot is disabled.
sourcepub fn disconnect_timeout(self, timeout: Seconds) -> Self
pub fn disconnect_timeout(self, timeout: Seconds) -> Self
Set client connection disconnect timeout.
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.
sourcepub fn memory_pool(self, id: PoolId) -> Self
pub fn memory_pool(self, id: PoolId) -> Self
Set memory pool.
Use specified memory pool for memory allocations. By default P5 memory pool is used.
sourcepub fn connector<U, F>(self, connector: F) -> MqttConnector<A, U> where
F: IntoService<U, Connect<A>>,
U: Service<Connect<A>, Error = ConnectError>,
IoBoxed: From<U::Response>,
pub fn connector<U, F>(self, connector: F) -> MqttConnector<A, U> where
F: IntoService<U, Connect<A>>,
U: Service<Connect<A>, Error = ConnectError>,
IoBoxed: From<U::Response>,
Use custom connector
sourceimpl<A, T> MqttConnector<A, T> where
A: Address + Clone,
T: Service<Connect<A>, Error = ConnectError>,
IoBoxed: From<T::Response>,
impl<A, T> MqttConnector<A, T> where
A: Address + Clone,
T: Service<Connect<A>, Error = ConnectError>,
IoBoxed: From<T::Response>,
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,
impl<A, T> !UnwindSafe for MqttConnector<A, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more