monoio_client::client

Struct ClientBuilder

Source
pub struct ClientBuilder<M>
where M: Connector,
{ /* private fields */ }
Expand description

Builder for Clients.

Instances of this are created by calling the Client::builder() method.

Implementations§

Source§

impl<M> ClientBuilder<M>
where M: Connector,

Source

pub fn build(self) -> Client<M>

Builds the Client.

§Errors

See [BuildError] for details.

Source

pub fn config(self, value: ClientConfig) -> Self

Sets a ClientConfig to build the Client with.

Source

pub fn max_size(self, value: usize) -> Self

Source

pub fn timeouts(self, value: Timeouts) -> Self

Source

pub fn wait_timeout(self, value: Option<Duration>) -> Self

Sets the Timeouts::wait value of the ClientConfig::timeouts.

Source

pub fn connect_timeout(self, value: Option<Duration>) -> Self

Source

pub fn reuse_timeout(self, value: Option<Duration>) -> Self

Sets the Timeouts::reuse value of the ClientConfig::timeouts.

Source

pub fn post_create(self, hook: impl Into<Hook<M>>) -> Self

Attaches a post_create hook.

The given hook will be called each time right after a new [PooledConnection] has been created.

Source

pub fn pre_reuse(self, hook: impl Into<Hook<M>>) -> Self

Attaches a pre_reuse hook.

The given hook will be called each time right before an [PooledConnection] will be reused.

Source

pub fn post_reuse(self, hook: impl Into<Hook<M>>) -> Self

Attaches a post_reuse hook.

The given hook will be called each time right after an [PooledConnection] has been reused.

Trait Implementations§

Source§

impl<M> Debug for ClientBuilder<M>
where M: Debug + Connector,

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<M> Freeze for ClientBuilder<M>
where M: Freeze,

§

impl<M> !RefUnwindSafe for ClientBuilder<M>

§

impl<M> !Send for ClientBuilder<M>

§

impl<M> !Sync for ClientBuilder<M>

§

impl<M> Unpin for ClientBuilder<M>
where M: Unpin,

§

impl<M> !UnwindSafe for ClientBuilder<M>

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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.