pub trait IsReady: GnsDroppable {
fn queue(&self) -> &SegQueue<GnsConnectionEvent>;
fn receive<const K: usize>(
&self,
gns: &GnsSocket<'_, '_, Self>,
messages: &mut [GnsNetworkMessage<ToReceive>; K]
) -> usize;
}
Expand description
Common functions available for any GnsSocket
state that is implementing it.
Regardless of being a client or server, a ready socket will allow us to query for connection events as well as receive messages.
Required Methods
fn queue(&self) -> &SegQueue<GnsConnectionEvent>
fn queue(&self) -> &SegQueue<GnsConnectionEvent>
Return a reference to the connection event queue. The queue is thread-safe.