Struct valence_server_common::ServerSettings
source · pub struct ServerSettings {
pub tick_rate: NonZeroU32,
pub compression_threshold: CompressionThreshold,
}
Fields§
§tick_rate: NonZeroU32
The target ticks per second (TPS) of the server. This is the number of game updates that should occur in one second.
On each game update (tick), the server is expected to update game logic and respond to packets from clients. Once this is complete, the server will sleep for any remaining time until a full tick duration has passed.
Note that the official Minecraft client only processes packets at 20hz, so there is little benefit to a tick rate higher than the default 20.
§Default Value
compression_threshold: CompressionThreshold
The compression threshold to use for compressing packets. For a
compression threshold of Some(N)
, packets with encoded lengths >= N
are compressed while all others are not. None
disables compression
completely.
If the server is used behind a proxy on the same machine, you will likely want to disable compression.
§Default Value
Compression is enabled with an unspecified value. This value may change in future versions.
Trait Implementations§
source§impl Clone for ServerSettings
impl Clone for ServerSettings
source§fn clone(&self) -> ServerSettings
fn clone(&self) -> ServerSettings
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Default for ServerSettings
impl Default for ServerSettings
impl Resource for ServerSettings
Auto Trait Implementations§
impl Freeze for ServerSettings
impl RefUnwindSafe for ServerSettings
impl Send for ServerSettings
impl Sync for ServerSettings
impl Unpin for ServerSettings
impl UnwindSafe for ServerSettings
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
].