pub struct NetworkConfig { /* private fields */ }Implementations§
Source§impl NetworkConfig
impl NetworkConfig
pub fn new() -> Self
Sourcepub const fn address_mut(&mut self) -> &mut NetAddr
pub const fn address_mut(&mut self) -> &mut NetAddr
returns a mutable reference to the address
Sourcepub const fn max_connections(&self) -> u16
pub const fn max_connections(&self) -> u16
returns the maximum number of connections
Sourcepub const fn max_connections_mut(&mut self) -> &mut u16
pub const fn max_connections_mut(&mut self) -> &mut u16
returns a mutable reference to the maximum number of connections
Sourcepub fn should_open(self) -> Self
pub fn should_open(self) -> Self
consumes the current instance to create another that should open by default
Sourcepub fn should_not_open(self) -> Self
pub fn should_not_open(self) -> Self
consumes the instance to create another that should not open by default
Sourcepub fn with_address(self, address: NetAddr) -> Self
pub fn with_address(self, address: NetAddr) -> Self
consumes the current instance to create another with the given address
Sourcepub fn with_basepath(self, basepath: impl ToString) -> Self
pub fn with_basepath(self, basepath: impl ToString) -> Self
consumes the current instance to create another with the given basepath
Sourcepub fn set_address(&mut self, address: NetAddr)
pub fn set_address(&mut self, address: NetAddr)
update the current address and return a mutable reference to self
Sourcepub fn set_basepath<T>(&mut self, basepath: T)where
T: ToString,
pub fn set_basepath<T>(&mut self, basepath: T)where
T: ToString,
update the current basepath and return a mutable reference to self
Sourcepub const fn set_max_connections(&mut self, max_connections: u16)
pub const fn set_max_connections(&mut self, max_connections: u16)
update the maximum number of connections and return a mutable reference to self
Sourcepub fn as_socket_addr(&self) -> SocketAddr
pub fn as_socket_addr(&self) -> SocketAddr
Returns an instance of the address as a SocketAddr
Sourcepub async fn bind(&self) -> Result<TcpListener>
pub async fn bind(&self) -> Result<TcpListener>
Binds the address to a TcpListener
Trait Implementations§
Source§impl Clone for NetworkConfig
impl Clone for NetworkConfig
Source§fn clone(&self) -> NetworkConfig
fn clone(&self) -> NetworkConfig
Returns a duplicate 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 NetworkConfig
impl Debug for NetworkConfig
Source§impl Default for NetworkConfig
impl Default for NetworkConfig
Source§fn default() -> NetworkConfig
fn default() -> NetworkConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for NetworkConfigwhere
NetworkConfig: Default,
impl<'de> Deserialize<'de> for NetworkConfigwhere
NetworkConfig: Default,
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 Display for NetworkConfig
impl Display for NetworkConfig
Source§impl Hash for NetworkConfig
impl Hash for NetworkConfig
Source§impl Ord for NetworkConfig
impl Ord for NetworkConfig
Source§fn cmp(&self, other: &NetworkConfig) -> Ordering
fn cmp(&self, other: &NetworkConfig) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for NetworkConfig
impl PartialEq for NetworkConfig
Source§impl PartialOrd for NetworkConfig
impl PartialOrd for NetworkConfig
Source§impl Serialize for NetworkConfig
impl Serialize for NetworkConfig
impl Eq for NetworkConfig
impl StructuralPartialEq for NetworkConfig
Auto Trait Implementations§
impl Freeze for NetworkConfig
impl RefUnwindSafe for NetworkConfig
impl Send for NetworkConfig
impl Sync for NetworkConfig
impl Unpin for NetworkConfig
impl UnwindSafe for NetworkConfig
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