pub struct ConnectionConfig {
pub available_bytes_per_tick: u64,
pub server_channels_config: Vec<ChannelConfig>,
pub client_channels_config: Vec<ChannelConfig>,
}Expand description
Configuration for a renet connection and its channels.
Fields§
§available_bytes_per_tick: u64The number of bytes that is available per update tick to send messages. Default: 60_000, at 60hz this is becomes 28.8 Mbps
server_channels_config: Vec<ChannelConfig>The channels that the server sends to the client.
The order of the channels in this Vec determines which channel has priority when generating packets.
Each tick, the first channel can consume up to available_bytes_per_tick,
used bytes are removed from it and passed to the next channel
client_channels_config: Vec<ChannelConfig>The channels that the client sends to the server.
The order of the channels in this Vec determines which channel has priority when generating packets.
Each tick, the first channel can consume up to available_bytes_per_tick,
used bytes are removed from it and passed to the next channel
Implementations§
Source§impl ConnectionConfig
impl ConnectionConfig
Sourcepub fn from_channels(
server: Vec<ChannelConfig>,
client: Vec<ChannelConfig>,
) -> Self
pub fn from_channels( server: Vec<ChannelConfig>, client: Vec<ChannelConfig>, ) -> Self
Makes a new config with default available_bytes_per_tick.
Makes a new config with default available_bytes_per_tick and the same server and client channels.
Sourcepub fn downgrade_to_unreliable(&mut self)
pub fn downgrade_to_unreliable(&mut self)
Downgrades all channels to SendType::Unreliable.
Used when setting up a client that has a socket with built-in reliability (such as WebSockets).
Trait Implementations§
Source§impl Clone for ConnectionConfig
impl Clone for ConnectionConfig
Source§fn clone(&self) -> ConnectionConfig
fn clone(&self) -> ConnectionConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ConnectionConfig
impl RefUnwindSafe for ConnectionConfig
impl Send for ConnectionConfig
impl Sync for ConnectionConfig
impl Unpin for ConnectionConfig
impl UnwindSafe for ConnectionConfig
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§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.