Struct tcp_client::config::ClientConfig
source · pub struct ClientConfig {
pub connect_sec: u64,
pub idle_sec: u64,
}
Expand description
Global configuration.
§Example
use tcp_client::config::ClientConfig;
let config = ClientConfig::default();
Fields§
§connect_sec: u64
connect_sec
is the timeout of connecting to the server.
Default value is 30
.
§Example
use tcp_client::config::ClientConfig;
let config = ClientConfig {
connect_sec: 30,
..ClientConfig::default()
};
idle_sec: u64
idle_sec
is the timeout of sending/receiving from the server.
This is only used after sending a packet.
Default value is 30
.
§Example
use tcp_client::config::ClientConfig;
let config = ClientConfig {
idle_sec: 30,
..ClientConfig::default()
};
Trait Implementations§
source§impl Clone for ClientConfig
impl Clone for ClientConfig
source§fn clone(&self) -> ClientConfig
fn clone(&self) -> ClientConfig
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ClientConfig
impl Debug for ClientConfig
source§impl Default for ClientConfig
impl Default for ClientConfig
source§impl<'de> Deserialize<'de> for ClientConfig
impl<'de> Deserialize<'de> for ClientConfig
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for ClientConfig
impl PartialEq for ClientConfig
source§fn eq(&self, other: &ClientConfig) -> bool
fn eq(&self, other: &ClientConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for ClientConfig
impl Serialize for ClientConfig
impl Copy for ClientConfig
impl Eq for ClientConfig
impl StructuralEq for ClientConfig
impl StructuralPartialEq for ClientConfig
Auto Trait Implementations§
impl RefUnwindSafe for ClientConfig
impl Send for ClientConfig
impl Sync for ClientConfig
impl Unpin for ClientConfig
impl UnwindSafe for ClientConfig
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more