Struct paho_mqtt::connect_options::ConnectOptions
source · [−]pub struct ConnectOptions { /* private fields */ }
Expand description
The collection of options for connecting to a broker.
This can be constructed using a ConnectOptionsBuilder
to set all the
options.
Implementations
sourceimpl ConnectOptions
impl ConnectOptions
sourcepub fn mqtt_version(&self) -> u32
pub fn mqtt_version(&self) -> u32
Gets the MQTT protocol version that should be used for the connection.
sourcepub fn set_mqtt_version(&mut self, ver: u32)
pub fn set_mqtt_version(&mut self, ver: u32)
Sets the MQTT protocol version that should be used for the connection.
This also insures that the other options are compatible with the
selected version. For example, when setting for v5, it will make
sure the cleansession
flag is cleared, since v5 uses cleanstart,
not cleansession.
sourcepub fn clean_session(&self) -> bool
pub fn clean_session(&self) -> bool
Gets the “clean session” setting in the options.
This is only used in MQTT v3 connections.
sourcepub fn set_clean_session(&mut self, clean: bool)
pub fn set_clean_session(&mut self, clean: bool)
This sets the “clean session” behavior for connecting to the server.
When set to true, this directs the server to throw away any state related to the client, as determined by the client identifier. When set to false, the server keeps the state information and resumes the previous session.
This is only used in MQTT v3 connections.
sourcepub fn clean_start(&self) -> bool
pub fn clean_start(&self) -> bool
Gets the “clean start” setting in the options.
This is only used in MQTT v5 connections.
sourcepub fn set_clean_start(&mut self, clean: bool)
pub fn set_clean_start(&mut self, clean: bool)
This sets the “clean start” behavior for connecting to the server.
When set to true, this directs the server to throw away any state related to the client, as determined by the client identifier. When set to false, the server keeps the state information and resumes the previous session.
This is only used in MQTT v5 connections.
sourcepub fn set_token(&mut self, tok: ConnectToken)
pub fn set_token(&mut self, tok: ConnectToken)
Sets the token to ber used for connect completion callbacks.
Note that we leak the token to give to the C lib. When we’re done with it, we must recover and drop it (i.e. in the completion callback).
Trait Implementations
sourceimpl Clone for ConnectOptions
impl Clone for ConnectOptions
sourceimpl Debug for ConnectOptions
impl Debug for ConnectOptions
sourceimpl Default for ConnectOptions
impl Default for ConnectOptions
impl Send for ConnectOptions
impl Sync for ConnectOptions
Auto Trait Implementations
impl RefUnwindSafe for ConnectOptions
impl Unpin for ConnectOptions
impl UnwindSafe for ConnectOptions
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> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more