pub struct ClientBuilder { /* private fields */ }
Expand description

Builder for Client with more options than Client::connect.

Implementations§

source§

impl ClientBuilder

source

pub fn with_session_timeout(&mut self, timeout: Duration) -> &mut Self

Specifies target session timeout to negotiate with ZooKeeper server.

Defaults to 6s.

source

pub fn with_connection_timeout(&mut self, timeout: Duration) -> &mut Self

Specifies idle timeout to conclude a connection as loss.

Defaults to 2/5 of session timeout.

source

pub fn with_readonly(&mut self, readonly: bool) -> &mut ClientBuilder

Specifies whether readonly server is allowed.

source

pub fn with_auth(&mut self, scheme: String, auth: Vec<u8>) -> &mut ClientBuilder

Specifies auth info for given authentication scheme.

source

pub fn with_session(&mut self, id: SessionId, password: Vec<u8>) -> &mut Self

Specifies session to reestablish.

source

pub fn assume_server_version( &mut self, major: u32, minor: u32, patch: u32 ) -> &mut Self

Specifies client assumed server version of ZooKeeper cluster.

Client will issue server compatible protocol to avoid Error::Unimplemented for some operations. See Client::create for an example.

See ZOOKEEPER-1381 and ZOOKEEPER-3762 for references.

source

pub fn detach(&mut self) -> &mut Self

Detaches creating session so it will not be closed after all client instances dropped.

source

pub async fn connect(&mut self, cluster: &str) -> Result<Client, Error>

Connects to ZooKeeper cluster.

Trait Implementations§

source§

impl Clone for ClientBuilder

source§

fn clone(&self) -> ClientBuilder

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ClientBuilder

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.