Skip to main content

IsReady

Trait IsReady 

Source
pub trait IsReady: Sealed {
    // Required methods
    fn queue(&self) -> &SegQueue<GnsConnectionEvent>;
    fn receive(
        &self,
        slots: &mut [MaybeUninit<*mut ISteamNetworkingMessage>],
    ) -> GnsResult<usize>;
}
Expand description

The operations that every ready GnsSocket supports.

A ready socket is either a client or a server. Both can read connection events and receive messages.

Required Methods§

Source

fn queue(&self) -> &SegQueue<GnsConnectionEvent>

Returns the connection event queue. The queue is thread-safe.

Source

fn receive( &self, slots: &mut [MaybeUninit<*mut ISteamNetworkingMessage>], ) -> GnsResult<usize>

Receives up to slots.len() messages into slots.

Returns the number of slots that GameNetworkingSockets filled, or GnsError::Receive if the underlying handle is invalid.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§