pub struct ClientBuilder { /* private fields */ }Available on crate feature
blocking only.Expand description
Builder of the blocking Client; the options of crate::ClientBuilder.
Implementations§
Source§impl ClientBuilder
impl ClientBuilder
Sourcepub fn new(address: impl Into<String>) -> Self
pub fn new(address: impl Into<String>) -> Self
A builder for address (see crate::ClientBuilder::new). Starts the runtime thread.
§Panics
When the OS refuses to start a thread.
Sourcepub fn transport_type(self, transport: TransportType) -> Self
pub fn transport_type(self, transport: TransportType) -> Self
Sourcepub fn reconnection(self, reconnection: bool) -> Self
pub fn reconnection(self, reconnection: bool) -> Self
Sourcepub fn reconnection_attempts(self, attempts: u32) -> Self
pub fn reconnection_attempts(self, attempts: u32) -> Self
Sourcepub fn reconnection_delay(self, delay: Duration) -> Self
pub fn reconnection_delay(self, delay: Duration) -> Self
Sourcepub fn reconnection_delay_max(self, delay: Duration) -> Self
pub fn reconnection_delay_max(self, delay: Duration) -> Self
Sourcepub fn randomization_factor(self, factor: f64) -> Self
pub fn randomization_factor(self, factor: f64) -> Self
Sourcepub fn reconnect_on_disconnect(self, reconnect: bool) -> Self
pub fn reconnect_on_disconnect(self, reconnect: bool) -> Self
Sourcepub fn buffer_while_disconnected(self, buffer: bool) -> Self
pub fn buffer_while_disconnected(self, buffer: bool) -> Self
Sourcepub fn redact_query(self, redact: bool) -> Self
pub fn redact_query(self, redact: bool) -> Self
Sourcepub fn tls_config(self, tls_config: impl Into<TlsConfig>) -> Self
Available on crate features native-tls or rustls only.
pub fn tls_config(self, tls_config: impl Into<TlsConfig>) -> Self
native-tls or rustls only.Sourcepub fn auth_with<F>(self, auth: F) -> Self
pub fn auth_with<F>(self, auth: F) -> Self
See crate::ClientBuilder::auth_with; auth runs on a blocking thread.
Sourcepub fn inspect_packets<F>(self, inspector: F) -> Self
pub fn inspect_packets<F>(self, inspector: F) -> Self
Sourcepub fn on<F>(self, event: impl Into<String>, handler: F) -> Self
pub fn on<F>(self, event: impl Into<String>, handler: F) -> Self
Handles event (on a blocking thread, in arrival order).
Sourcepub fn once<F>(self, event: impl Into<String>, handler: F) -> Self
pub fn once<F>(self, event: impl Into<String>, handler: F) -> Self
Handles the next event only.
Sourcepub fn on_state_change<F>(self, handler: F) -> Self
pub fn on_state_change<F>(self, handler: F) -> Self
Sees every state transition.
Sourcepub fn connect(self) -> Result<Client>
pub fn connect(self) -> Result<Client>
Connects (see crate::ClientBuilder::connect), blocking until CONNECT or failure.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ClientBuilder
impl !UnwindSafe for ClientBuilder
impl Forget for ClientBuilder
impl Freeze for ClientBuilder
impl Send for ClientBuilder
impl Sync for ClientBuilder
impl Unpin for ClientBuilder
impl UnsafeUnpin 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