Struct valence_network::NetworkSettings
source · pub struct NetworkSettings {
pub callbacks: ErasedNetworkCallbacks,
pub tokio_handle: Option<Handle>,
pub max_connections: usize,
pub max_players: usize,
pub address: SocketAddr,
pub connection_mode: ConnectionMode,
pub incoming_byte_limit: usize,
pub outgoing_byte_limit: usize,
}
Expand description
Settings for NetworkPlugin
. Note that mutations to these fields have no
effect after the plugin is built.
Fields§
§callbacks: ErasedNetworkCallbacks
§tokio_handle: Option<Handle>
The [Handle
] to the tokio runtime the server will use. If None
is
provided, the server will create its own tokio runtime at startup.
§Default Value
None
max_connections: usize
The maximum number of simultaneous initial connections to the server.
This only considers the connections before the play state where the client is spawned into the world..
§Default Value
The default value is left unspecified and may change in future versions.
max_players: usize
§Default Value
20
address: SocketAddr
The socket address the server will be bound to.
§Default Value
0.0.0.0:25565
, which will listen on every available network interface.
connection_mode: ConnectionMode
The connection mode. This determines if client authentication and encryption should take place and if the server should get the player data from a proxy.
NOTE: Mutations to this field have no effect if
§Default Value
incoming_byte_limit: usize
The maximum capacity (in bytes) of the buffer used to hold incoming packet data.
A larger capacity reduces the chance that a client needs to be disconnected due to a full buffer, but increases potential memory usage.
§Default Value
The default value is left unspecified and may change in future versions.
outgoing_byte_limit: usize
The maximum capacity (in bytes) of the buffer used to hold outgoing packet data.
A larger capacity reduces the chance that a client needs to be disconnected due to a full buffer, but increases potential memory usage.
§Default Value
The default value is left unspecified and may change in future versions.
Trait Implementations§
source§impl Clone for NetworkSettings
impl Clone for NetworkSettings
source§fn clone(&self) -> NetworkSettings
fn clone(&self) -> NetworkSettings
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Default for NetworkSettings
impl Default for NetworkSettings
impl Resource for NetworkSettings
Auto Trait Implementations§
impl Freeze for NetworkSettings
impl !RefUnwindSafe for NetworkSettings
impl Send for NetworkSettings
impl Sync for NetworkSettings
impl Unpin for NetworkSettings
impl !UnwindSafe for NetworkSettings
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Self
using data from the given [World
].