[−][src]Struct rumqttc::MqttOptions
Implementations
impl MqttOptions
[src]
pub fn new<S: Into<String>, T: Into<String>>(
id: S,
host: T,
port: u16
) -> MqttOptions
[src]
id: S,
host: T,
port: u16
) -> MqttOptions
New mqtt options
pub fn broker_address(&self) -> (String, u16)
[src]
Broker address
pub fn set_last_will(&mut self, will: LastWill) -> &mut Self
[src]
pub fn last_will(&self) -> Option<LastWill>
[src]
pub fn set_ca(&mut self, ca: Vec<u8>) -> &mut Self
[src]
Set the CA certificate to use for TLS connections. Doing so implicitly enables TLS.
See set_client_auth
, set_alpn
and set_key_type
. If you want to control more options
then you can inject a rustls ClientConfig directly with set_tls_client_config
.
pub fn ca(&self) -> Option<Vec<u8>>
[src]
pub fn set_client_auth(&mut self, cert: Vec<u8>, key: Vec<u8>) -> &mut Self
[src]
pub fn client_auth(&self) -> Option<(Vec<u8>, Vec<u8>)>
[src]
pub fn set_alpn(&mut self, alpn: Vec<Vec<u8>>) -> &mut Self
[src]
pub fn alpn(&self) -> Option<Vec<Vec<u8>>>
[src]
pub fn set_keep_alive(&mut self, secs: u16) -> &mut Self
[src]
Set number of seconds after which client should ping the broker if there is no other data exchange
pub fn keep_alive(&self) -> Duration
[src]
Keep alive time
pub fn client_id(&self) -> String
[src]
Client identifier
pub fn set_max_packet_size(
&mut self,
incoming: usize,
outgoing: usize
) -> &mut Self
[src]
&mut self,
incoming: usize,
outgoing: usize
) -> &mut Self
Set packet size limit for outgoing an incoming packets
pub fn max_packet_size(&self) -> usize
[src]
Maximum packet size
pub fn set_max_request_batch(&mut self, max: usize) -> &mut Self
[src]
Maximum internal batching of requests
pub fn set_clean_session(&mut self, clean_session: bool) -> &mut Self
[src]
clean_session = true
removes all the state from queues & instructs the broker
to clean all the client state when client disconnects.
When set false
, broker will hold the client state and performs pending
operations on the client when reconnection with same client_id
happens. Local queue state is also held to retransmit packets after reconnection.
pub fn clean_session(&self) -> bool
[src]
Clean session
pub fn set_credentials<S: Into<String>>(
&mut self,
username: S,
password: S
) -> &mut Self
[src]
&mut self,
username: S,
password: S
) -> &mut Self
Username and password
pub fn credentials(&self) -> Option<(String, String)>
[src]
Security options
pub fn set_request_channel_capacity(&mut self, capacity: usize) -> &mut Self
[src]
Set request channel capacity
pub fn request_channel_capacity(&self) -> usize
[src]
Request channel capacity
pub fn set_pending_throttle(&mut self, duration: Duration) -> &mut Self
[src]
Enables throttling and sets outoing message rate to the specified 'rate'
pub fn pending_throttle(&self) -> Duration
[src]
Outgoing message rate
pub fn set_inflight(&mut self, inflight: u16) -> &mut Self
[src]
Set number of concurrent in flight messages
pub fn inflight(&self) -> u16
[src]
Number of concurrent in flight messages
pub fn set_key_type(&mut self, key_type: Key) -> &mut Self
[src]
Use this setter to modify key_type enum, by default RSA
pub fn get_key_type(&self) -> Key
[src]
get key type
pub fn set_tls_client_config(
&mut self,
tls_client_config: Arc<ClientConfig>
) -> &mut Self
[src]
&mut self,
tls_client_config: Arc<ClientConfig>
) -> &mut Self
Inject a rustls ClientConfig to use for making a TLS connection.
Doing so implicitly enabled TLS. You must not set both this and the other TLS options (set_ca, set_client_auth, set_alpn)
pub fn tls_client_config(&self) -> Option<Arc<ClientConfig>>
[src]
Get the ClientConfig which was previously set, if any.
pub fn set_collision_safety(&mut self, c: bool) -> &mut Self
[src]
pub fn collision_safety(&self) -> bool
[src]
pub fn set_connection_timeout(&mut self, timeout: u64) -> &mut Self
[src]
set connection timeout in secs
pub fn connection_timeout(&self) -> u64
[src]
get timeout in secs
Trait Implementations
impl Clone for MqttOptions
[src]
fn clone(&self) -> MqttOptions
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for MqttOptions
[src]
Auto Trait Implementations
impl !RefUnwindSafe for MqttOptions
impl Send for MqttOptions
impl Sync for MqttOptions
impl Unpin for MqttOptions
impl !UnwindSafe for MqttOptions
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, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,