Struct tcp_server::config::ServerConfig
source · pub struct ServerConfig {
pub addr: String,
pub connect_sec: u64,
pub idle_sec: u64,
}
Expand description
Global configuration.
§Example
use tcp_server::config::ServerConfig;
let config = ServerConfig::default();
Fields§
§addr: String
addr
is the address the server bind.
Default value is localhost:0
.
§Example
use tcp_server::config::ServerConfig;
let config = ServerConfig {
addr: "localhost:0".to_string(),
..ServerConfig::default()
};
connect_sec: u64
connect_sec
is the timeout of connecting from the client.
Default value is 30
.
§Example
use tcp_server::config::ServerConfig;
let config = ServerConfig {
connect_sec: 30,
..ServerConfig::default()
};
idle_sec: u64
idle_sec
is the timeout of sending/receiving message.
Default value is 30
.
§Example
use tcp_server::config::ServerConfig;
let config = ServerConfig {
idle_sec: 30,
..ServerConfig::default()
};
Trait Implementations§
source§impl Clone for ServerConfig
impl Clone for ServerConfig
source§fn clone(&self) -> ServerConfig
fn clone(&self) -> ServerConfig
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 ServerConfig
impl Debug for ServerConfig
source§impl Default for ServerConfig
impl Default for ServerConfig
source§impl PartialEq for ServerConfig
impl PartialEq for ServerConfig
source§fn eq(&self, other: &ServerConfig) -> bool
fn eq(&self, other: &ServerConfig) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for ServerConfig
impl StructuralEq for ServerConfig
impl StructuralPartialEq for ServerConfig
Auto Trait Implementations§
impl RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
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