pub struct ClientBuilder { /* private fields */ }Expand description
Builder for synchronous MQTT clients.
The request channel is bounded by default using
MqttOptions::request_channel_capacity. Use Self::capacity to override
the bounded capacity, or Self::unbounded to opt into an unbounded request channel.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub const fn new(options: MqttOptions) -> ClientBuilder
pub const fn new(options: MqttOptions) -> ClientBuilder
Create a new builder for a synchronous Client.
Sourcepub const fn capacity(self, cap: usize) -> ClientBuilder
pub const fn capacity(self, cap: usize) -> ClientBuilder
Use a bounded request channel with the given capacity.
0 creates a bounded zero-capacity rendezvous channel. Use Self::unbounded
for an unbounded request channel.
Sourcepub const fn unbounded(self) -> ClientBuilder
pub const fn unbounded(self) -> ClientBuilder
Use an unbounded request channel.
Sourcepub fn build(self) -> (Client, Connection)
pub fn build(self) -> (Client, Connection)
Build a synchronous client and connection.
This builder always produces the synchronous client pair so the
terminal build() method matches the entry point that created it.
§Panics
Panics if the current-thread Tokio runtime cannot be created.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for ClientBuilder
impl !RefUnwindSafe for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin for ClientBuilder
impl !UnwindSafe for ClientBuilder
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