pub struct NetworkSession {Show 14 fields
pub session_id: String,
pub session_name: String,
pub topology: NetworkTopology,
pub state: SessionState,
pub max_players: u32,
pub players: Vec<NetworkPlayer>,
pub map_name: String,
pub game_mode: String,
pub is_private: bool,
pub server_region: String,
pub server_ip: String,
pub server_port: u16,
pub tick_rate: u32,
pub uptime_secs: f64,
}Fields§
§session_id: String§session_name: String§topology: NetworkTopology§state: SessionState§max_players: u32§players: Vec<NetworkPlayer>§map_name: String§game_mode: String§is_private: bool§server_region: String§server_ip: String§server_port: u16§tick_rate: u32§uptime_secs: f64Implementations§
Source§impl NetworkSession
impl NetworkSession
pub fn new_lobby(name: &str) -> Self
pub fn player_count(&self) -> u32
pub fn is_full(&self) -> bool
pub fn average_ping(&self) -> f32
pub fn host_player(&self) -> Option<&NetworkPlayer>
pub fn all_ready(&self) -> bool
pub fn total_bandwidth_kbps(&self) -> f32
Trait Implementations§
Source§impl Clone for NetworkSession
impl Clone for NetworkSession
Auto Trait Implementations§
impl Freeze for NetworkSession
impl RefUnwindSafe for NetworkSession
impl Send for NetworkSession
impl Sync for NetworkSession
impl Unpin for NetworkSession
impl UnsafeUnpin for NetworkSession
impl UnwindSafe for NetworkSession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.