[][src]Struct cdrs::cluster::NodeTcpConfigBuilder

pub struct NodeTcpConfigBuilder<'a, A> { /* fields omitted */ }

Builder structure that helps to configure TCP connection for node.

Methods

impl<'a, A: Authenticator + Sized> NodeTcpConfigBuilder<'a, A>[src]

pub fn new<'b>(addr: &'b str, authenticator: A) -> NodeTcpConfigBuilder<'b, A>[src]

NodeTcpConfigBuilder constructor function. It receivesthread::spawn(move || {

  • node socket address as a string
  • authenticator

pub fn max_size(self, size: u32) -> Self[src]

Sets the maximum number of connections managed by the pool. Defaults to 10.

pub fn min_idle(self, min_idle: Option<u32>) -> Self[src]

Sets the minimum idle connection count maintained by the pool. If set, the pool will try to maintain at least this many idle connections at all times, while respecting the value of max_size. Defaults to None (equivalent to the value of max_size).

pub fn max_lifetime(self, max_lifetime: Option<Duration>) -> Self[src]

Sets the maximum lifetime of connections in the pool. If set, connections will be closed after existing for at most 30 seconds beyond this duration. If a connection reaches its maximum lifetime while checked out it will be closed when it is returned to the pool. Defaults to 30 minutes.

pub fn idle_timeout(self, idle_timeout: Option<Duration>) -> Self[src]

Sets the idle timeout used by the pool. If set, connections will be closed after sitting idle for at most 30 seconds beyond this duration. Defaults to 10 minutes.

pub fn connection_timeout(self, connection_timeout: Duration) -> Self[src]

Sets the connection timeout used by the pool. Defaults to 30 seconds.

pub fn authenticator(self, authenticator: A) -> Self[src]

Sets new authenticator.

pub fn build(self) -> NodeTcpConfig<'a, A>[src]

Finalizes building process and returns NodeSslConfig

Auto Trait Implementations

impl<'a, A> Send for NodeTcpConfigBuilder<'a, A> where
    A: Send

impl<'a, A> Unpin for NodeTcpConfigBuilder<'a, A> where
    A: Unpin

impl<'a, A> Sync for NodeTcpConfigBuilder<'a, A> where
    A: Sync

impl<'a, A> UnwindSafe for NodeTcpConfigBuilder<'a, A> where
    A: UnwindSafe

impl<'a, A> RefUnwindSafe for NodeTcpConfigBuilder<'a, A> where
    A: RefUnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]