Struct tokio_zookeeper::ZooKeeperBuilder
source · pub struct ZooKeeperBuilder { /* private fields */ }
Expand description
Builder that allows customizing options for ZooKeeper connections.
Implementations§
source§impl ZooKeeperBuilder
impl ZooKeeperBuilder
sourcepub async fn connect(
self,
addr: &SocketAddr
) -> Result<(ZooKeeper, impl Stream<Item = WatchedEvent>), Whatever>
pub async fn connect( self, addr: &SocketAddr ) -> Result<(ZooKeeper, impl Stream<Item = WatchedEvent>), Whatever>
Connect to a ZooKeeper server instance at the given address.
A ZooKeeper
instance is returned, along with a “watcher” that will provide notifications
of any changes in state.
If the connection to the server fails, the client will automatically try to re-connect. Only if re-connection fails is an error returned to the client. Requests that are in-flight during a disconnect may fail and have to be retried.
sourcepub fn set_timeout(&mut self, t: Duration)
pub fn set_timeout(&mut self, t: Duration)
Set the ZooKeeper session expiry timeout.
The default timeout is dictated by the server.
Trait Implementations§
source§impl Clone for ZooKeeperBuilder
impl Clone for ZooKeeperBuilder
source§fn clone(&self) -> ZooKeeperBuilder
fn clone(&self) -> ZooKeeperBuilder
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ZooKeeperBuilder
impl Debug for ZooKeeperBuilder
source§impl Default for ZooKeeperBuilder
impl Default for ZooKeeperBuilder
impl Copy for ZooKeeperBuilder
Auto Trait Implementations§
impl Freeze for ZooKeeperBuilder
impl RefUnwindSafe for ZooKeeperBuilder
impl Send for ZooKeeperBuilder
impl Sync for ZooKeeperBuilder
impl Unpin for ZooKeeperBuilder
impl UnwindSafe for ZooKeeperBuilder
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