IoConfig

Struct IoConfig 

Source
pub struct IoConfig { /* private fields */ }
Expand description

Base io configuration

Implementations§

Source§

impl IoConfig

Source

pub fn new() -> IoConfig

Create new config object

Source

pub fn tag(&self) -> &str

Get tag

Source

pub fn connect_timeout(&self) -> Millis

Get connect timeout

Source

pub fn keepalive_timeout(&self) -> Seconds

Get keep-alive timeout

Source

pub fn disconnect_timeout(&self) -> Seconds

Get disconnect timeout

Source

pub fn frame_read_rate(&self) -> Option<&FrameReadRate>

Get frame read params

Source

pub fn read_buf(&self) -> &BufConfig

Get read buffer parameters

Source

pub fn write_buf(&self) -> &BufConfig

Get write buffer parameters

Source

pub fn set_connect_timeout<T: Into<Millis>>(self, timeout: T) -> Self

Set connect timeout in seconds.

To disable timeout set value to 0.

By default connect timeout is disabled.

Source

pub fn set_keepalive_timeout<T: Into<Seconds>>(self, timeout: T) -> Self

Set keep-alive timeout in seconds.

To disable timeout set value to 0.

By default keep-alive timeout is disabled.

Source

pub fn set_disconnect_timeout<T: Into<Seconds>>(self, timeout: T) -> Self

Set connection disconnect timeout.

Defines a timeout for disconnect connection. If a disconnect procedure does not complete within this time, the connection get dropped.

To disable timeout set value to 0.

By default disconnect timeout is set to 1 seconds.

Source

pub fn set_frame_read_rate( self, timeout: Seconds, max_timeout: Seconds, rate: u32, ) -> Self

Set read rate parameters for single frame.

Set read timeout, max timeout and rate for reading payload. If the client sends rate amount of data within timeout period of time, extend timeout by timeout seconds. But no more than max_timeout timeout.

By default frame read rate is disabled.

Source

pub fn set_read_buf( self, high_watermark: usize, low_watermark: usize, cache_size: usize, ) -> Self

Set read buffer parameters.

By default high watermark is set to 16Kb, low watermark 1kb.

Source

pub fn set_write_buf( self, high_watermark: usize, low_watermark: usize, cache_size: usize, ) -> Self

Set write buffer parameters.

By default high watermark is set to 16Kb, low watermark 1kb.

Trait Implementations§

Source§

impl Clone for IoConfig

Source§

fn clone(&self) -> IoConfig

Returns a duplicate 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 Configuration for IoConfig

Source§

const NAME: &str = "IO Configuration"

Source§

fn default() -> &'static Self

Get default config item
Source§

fn ctx(&self) -> &CfgContext

Source§

fn set_ctx(&mut self, ctx: CfgContext)

Source§

impl Debug for IoConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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,

Source§

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

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.