pub struct TetherAgentOptionsBuilder { /* private fields */ }Implementations§
Source§impl TetherAgentOptionsBuilder
impl TetherAgentOptionsBuilder
Sourcepub fn new(role: &str) -> Self
pub fn new(role: &str) -> Self
Initialise Tether Options struct with default options; call other methods to customise.
Call build() to get the actual TetherAgent instance (and connect automatically, by default)
Sourcepub fn id(self, id: Option<&str>) -> Self
pub fn id(self, id: Option<&str>) -> Self
Optionally sets the Tether ID, as used in auto-generating topics such as myRole/myID/myChannel not the MQTT Client ID.
Provide Some(value) to override or None to use the default any (when publishing) or + when subscribing.
Sourcepub fn protocol(self, protocol: Option<&str>) -> Self
pub fn protocol(self, protocol: Option<&str>) -> Self
Provide Some(value) to override or None to use default
Sourcepub fn mqtt_client_id(self, client_id: Option<&str>) -> Self
pub fn mqtt_client_id(self, client_id: Option<&str>) -> Self
Optionally set the MQTT Client ID used when connecting to the MQTT broker. This is not the same as the Tether ID used for auto-generating topics.
By default we use a UUID for this value, in order to avoid hard-to-debug issues where Tether Agent instances share the same Client ID and therefore events/messages are not handled properly by all instances.
Sourcepub fn host(self, host: Option<&str>) -> Self
pub fn host(self, host: Option<&str>) -> Self
Provide Some(value) to override or None to use default
pub fn port(self, port: Option<u16>) -> Self
Sourcepub fn username(self, username: Option<&str>) -> Self
pub fn username(self, username: Option<&str>) -> Self
Provide Some(value) to override or None to use default
Sourcepub fn password(self, password: Option<&str>) -> Self
pub fn password(self, password: Option<&str>) -> Self
Provide Some(value) to override or None to use default
Sourcepub fn base_path(self, base_path: Option<&str>) -> Self
pub fn base_path(self, base_path: Option<&str>) -> Self
Provide Some(value) to override or None to use default
pub fn auto_connect(self, should_auto_connect: bool) -> Self
pub fn build(self) -> Result<TetherAgent>
Trait Implementations§
Source§impl Clone for TetherAgentOptionsBuilder
impl Clone for TetherAgentOptionsBuilder
Source§fn clone(&self) -> TetherAgentOptionsBuilder
fn clone(&self) -> TetherAgentOptionsBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more