pub struct GnsGlobal { /* private fields */ }Expand description
Owns the initialization and teardown of GameNetworkingSockets and its singletons.
Call GnsGlobal::get() to obtain the instance. The first call initializes
GameNetworkingSockets, and later calls return the same instance.
Implementations§
Source§impl GnsGlobal
impl GnsGlobal
Sourcepub fn get() -> GnsResult<&'static Self>
pub fn get() -> GnsResult<&'static Self>
Returns a reference to the GnsGlobal instance.
The first call initializes GameNetworkingSockets through
sys::GameNetworkingSockets_Init. Later calls return the instance
that call created.
§Errors
Returns GnsError::Init with the message that GameNetworkingSockets
produced if initialization fails.
pub fn poll_callbacks(&self)
pub fn utils(&self) -> &GnsUtils
pub fn queue_count(&self) -> usize
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for GnsGlobal
impl RefUnwindSafe for GnsGlobal
impl Send for GnsGlobal
impl Sync for GnsGlobal
impl Unpin for GnsGlobal
impl UnsafeUnpin for GnsGlobal
impl UnwindSafe for GnsGlobal
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