pub struct MqttConfig {
pub broker_url: String,
pub client_id: Option<String>,
pub username: Option<String>,
pub password: Option<String>,
pub keep_alive: u16,
pub clean_session: bool,
pub topics: Vec<MqttTopic>,
}Fields§
§broker_url: String§client_id: Option<String>§username: Option<String>§password: Option<String>§keep_alive: u16§clean_session: bool§topics: Vec<MqttTopic>Implementations§
Source§impl MqttConfig
impl MqttConfig
pub fn new(broker_url: impl Into<String>) -> MqttConfig
pub fn with_client_id(self, client_id: impl Into<String>) -> MqttConfig
pub fn with_auth( self, username: impl Into<String>, password: impl Into<String>, ) -> MqttConfig
pub fn with_keep_alive(self, seconds: u16) -> MqttConfig
pub fn with_topics(self, topics: Vec<MqttTopic>) -> MqttConfig
pub fn add_topic(self, topic: MqttTopic) -> MqttConfig
Trait Implementations§
Source§impl Default for MqttConfig
impl Default for MqttConfig
Source§fn default() -> MqttConfig
fn default() -> MqttConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MqttConfig
impl RefUnwindSafe for MqttConfig
impl Send for MqttConfig
impl Sync for MqttConfig
impl Unpin for MqttConfig
impl UnsafeUnpin for MqttConfig
impl UnwindSafe for MqttConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more