pub struct ClientConfig {
    pub nodelay: Option<bool>,
    pub ttl: Option<u32>,
    pub linger: Option<Option<Duration>>,
}
Expand description

configuration for the tcp Connector

Fields§

§nodelay: Option<bool>

disable nagle’s algorithm see [TcpStream::set_nodelay] for more info

§ttl: Option<u32>

time to live for the tcp protocol. set [TcpStream::set_ttl] for more info

§linger: Option<Option<Duration>>

sets SO_LINGER. I don’t really understand this, but see [TcpStream::set_linger] for more info

Implementations§

source§

impl ClientConfig

source

pub const fn new() -> Self

constructs a default ClientConfig

source

pub const fn with_nodelay(self, nodelay: bool) -> Self

chainable setter to set default nodelay

source

pub const fn with_ttl(self, ttl: u32) -> Self

chainable setter for ip ttl

source

pub const fn with_linger(self, linger: Option<Duration>) -> Self

chainable setter for linger

Trait Implementations§

source§

impl Clone for ClientConfig

source§

fn clone(&self) -> ClientConfig

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 Connector for ClientConfig

§

type Transport = TokioTransport<Compat<TcpStream>>

source§

fn connect<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 Url ) -> Pin<Box<dyn Future<Output = Result<Self::Transport>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Initiate a connection to the provided url Read more
source§

fn spawn<Fut: Future<Output = ()> + Send + 'static>(&self, fut: Fut)

source§

impl Debug for ClientConfig

source§

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

Formats the value using the given formatter. Read more
source§

impl Default for ClientConfig

source§

fn default() -> ClientConfig

Returns the “default value” for a type. Read more
source§

impl Copy for ClientConfig

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
§

impl<T> CompatExt for T

§

fn compat(self) -> Compat<T>

Applies the [Compat] adapter by value. Read more
§

fn compat_ref(&self) -> Compat<&T>

Applies the [Compat] adapter by shared reference. Read more
§

fn compat_mut(&mut self) -> Compat<&mut T>

Applies the [Compat] adapter by mutable reference. 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.

§

impl<T> ObjectSafeConnector for T
where T: Connector,

§

fn connect<'life0, 'life1, 'async_trait>( &'life0 self, url: &'life1 Url ) -> Pin<Box<dyn Future<Output = Result<BoxedTransport, Error>> + Send + 'async_trait>>
where 'life0: 'async_trait, 'life1: 'async_trait, T: 'async_trait,

§

fn spawn(&self, fut: Pin<Box<dyn Future<Output = ()> + Send>>)

§

fn boxed(self) -> Box<dyn ObjectSafeConnector>
where Self: Sized,

§

fn arced(self) -> Arc<dyn ObjectSafeConnector>
where Self: Sized,

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.