pub struct NetworkConfig {
pub mode: NetworkMode,
pub max_peers: u32,
}Expand description
Configuration for the networking subsystem.
Used with [GameBuilder::with_network].
Fields§
§mode: NetworkMode§max_peers: u32Implementations§
Source§impl NetworkConfig
impl NetworkConfig
Sourcepub fn host(port: u16) -> NetworkConfig
pub fn host(port: u16) -> NetworkConfig
Convenience: host on a given port with default max peers.
Sourcepub fn client(addr: impl Into<String>) -> NetworkConfig
pub fn client(addr: impl Into<String>) -> NetworkConfig
Convenience: connect to a remote address with default max peers.
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 (const: unstable) · 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
Auto Trait Implementations§
impl Freeze for NetworkConfig
impl RefUnwindSafe for NetworkConfig
impl Send for NetworkConfig
impl Sync for NetworkConfig
impl Unpin for NetworkConfig
impl UnsafeUnpin 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