pub struct GnsSocket<'x, 'y, S: GnsDroppable> { /* private fields */ }
Expand description
GnsSocket
is the most important structure of this library.
This structure is used to create client (GnsSocket<IsClient>
) and server (GnsSocket<IsServer>
) sockets via the GnsSocket::connect
and GnsSocket::listen
functions.
The drop implementation make sure that everything related to this structure is correctly freed, except the GnsGlobal
and GnsUtils
instances and the user has a strong guarantee that all the available operations over the socket are safe.
Implementations
sourceimpl<'x, 'y, S> GnsSocket<'x, 'y, S> where
S: GnsDroppable,
impl<'x, 'y, S> GnsSocket<'x, 'y, S> where
S: GnsDroppable,
pub unsafe fn into_inner(self) -> *mut ISteamNetworkingSockets
pub fn utils(&self) -> &GnsUtils
sourceimpl<'x, 'y, S> GnsSocket<'x, 'y, S> where
S: GnsDroppable + IsReady,
impl<'x, 'y, S> GnsSocket<'x, 'y, S> where
S: GnsDroppable + IsReady,
sourcepub fn get_connection_real_time_status(
&self,
GnsConnection: GnsConnection,
nb_of_lanes: u32
) -> GnsResult<(GnsConnectionRealTimeStatus, Vec<GnsConnectionRealTimeLaneStatus>)>
pub fn get_connection_real_time_status(
&self,
GnsConnection: GnsConnection,
nb_of_lanes: u32
) -> GnsResult<(GnsConnectionRealTimeStatus, Vec<GnsConnectionRealTimeLaneStatus>)>
Get a connection lane status. This call is possible only if lanes has been previously configured using configure_connection_lanes
pub fn get_connection_info(
&self,
GnsConnection: GnsConnection
) -> Option<GnsConnectionInfo>
pub fn flush_messages_on_connection(
&self,
GnsConnection: GnsConnection
) -> GnsResult<()>
pub fn close_connection(
&self,
GnsConnection: GnsConnection,
reason: u32,
debug: &str,
linger: bool
) -> bool
pub fn poll_messages<const K: usize, F>(&self, message_callback: F) -> usize where
F: FnMut(&GnsNetworkMessage<ToReceive>),
pub fn poll_event<const K: usize, F>(&self, event_callback: F) -> usize where
F: FnMut(GnsConnectionEvent),
pub fn poll_callbacks(&self)
pub fn configure_connection_lanes(
&self,
GnsConnection: GnsConnection,
lanes: &[GnsLane]
) -> GnsResult<()>
pub fn send_messages(
&self,
messages: Vec<GnsNetworkMessage<ToSend>>
) -> Vec<Either<GnsMessageNumber, EResult>>
sourceimpl<'x, 'y> GnsSocket<'x, 'y, IsCreated>
impl<'x, 'y> GnsSocket<'x, 'y, IsCreated>
sourceimpl<'x, 'y> GnsSocket<'x, 'y, IsClient>
impl<'x, 'y> GnsSocket<'x, 'y, IsClient>
sourcepub fn connection(&self) -> GnsConnection
pub fn connection(&self) -> GnsConnection
Return the socket connection. This operation is available only if the socket is in the IsClient
state.
Trait Implementations
Auto Trait Implementations
impl<'x, 'y, S> RefUnwindSafe for GnsSocket<'x, 'y, S> where
S: RefUnwindSafe,
impl<'x, 'y, S> !Send for GnsSocket<'x, 'y, S>
impl<'x, 'y, S> !Sync for GnsSocket<'x, 'y, S>
impl<'x, 'y, S> Unpin for GnsSocket<'x, 'y, S> where
S: Unpin,
impl<'x, 'y, S> UnwindSafe for GnsSocket<'x, 'y, S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more