Struct Config
pub struct Config {Show 13 fields
pub client_id: ClientId,
broker_url: BrokerUrl,
pub persistence_dir: Option<Box<Path>>,
pub tls: Config,
pub subscription_buffer_size: usize,
pub max_buffered_messages: usize,
pub command_buffer_size: usize,
pub connect: Connect,
pub subscribe_timeout: Duration,
pub disconnect_timeout: Duration,
pub keep_alive_interval: Duration,
pub max_inflight: usize,
pub session_expiry_interval: Duration,
}Fields§
§client_id: ClientId§broker_url: BrokerUrl§persistence_dir: Option<Box<Path>>§tls: Config§subscription_buffer_size: usize§max_buffered_messages: usize§command_buffer_size: usize§connect: Connect§subscribe_timeout: Duration§disconnect_timeout: Duration§keep_alive_interval: Duration§max_inflight: usize§session_expiry_interval: DurationImplementations§
§impl Config
impl Config
pub fn new(broker_url: BrokerUrl) -> Self
pub fn new(broker_url: BrokerUrl) -> Self
Creates a new Config with the given broker URL and TLS configuration.
pub fn has_client_id(&self) -> bool
pub fn set_default_client_id(&mut self, client_id: String)
pub async fn build(self) -> Result<Mqtt, Error>
pub(crate) fn apply_defaults(&mut self)
pub(crate) fn create_client( &self, client_id: String, ) -> Result<AsyncClient, Error>
pub(crate) async fn create_connect_opts(&self) -> Result<ConnectOptions, Error>
Trait Implementations§
§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more