pub struct GnsNetworkMessage<T>(/* private fields */);Expand description
A GameNetworkingSockets message, tagged with its direction.
The library produces ToReceive messages. You create ToSend messages with
GnsUtils::allocate_message, and they own their payload through
Payload. Both kinds are released when dropped.
Implementations§
Source§impl<T> GnsNetworkMessage<T>
impl<T> GnsNetworkMessage<T>
Sourcepub unsafe fn into_inner(self) -> *mut ISteamNetworkingMessage
pub unsafe fn into_inner(self) -> *mut ISteamNetworkingMessage
pub fn payload(&self) -> &[u8] ⓘ
pub fn message_number(&self) -> u64
Sourcepub fn time_received(&self) -> SteamNetworkingMicroseconds
pub fn time_received(&self) -> SteamNetworkingMicroseconds
Returns the local timestamp at which the message arrived, in microseconds.
The value shares its timebase with GnsUtils::local_timestamp, so
compare the two to compute how long a message sat in the receive queue.
It is meaningless on a message you allocated yourself.
pub fn lane(&self) -> GnsLaneId
pub fn flags(&self) -> SendFlags
pub fn user_data(&self) -> u64
pub fn connection(&self) -> GnsConnection
pub fn connection_user_data(&self) -> u64
Source§impl GnsNetworkMessage<ToSend>
impl GnsNetworkMessage<ToSend>
pub fn set_connection(self, GnsConnection: GnsConnection) -> Self
pub fn set_lane(self, lane: GnsLaneId) -> Self
pub fn set_flags(self, flags: SendFlags) -> Self
pub fn set_user_data(self, userdata: u64) -> Self
Trait Implementations§
Source§impl<T> Drop for GnsNetworkMessage<T>
impl<T> Drop for GnsNetworkMessage<T>
Auto Trait Implementations§
impl<T> !Send for GnsNetworkMessage<T>
impl<T> !Sync for GnsNetworkMessage<T>
impl<T> Freeze for GnsNetworkMessage<T>where
PhantomData<T>: Freeze,
impl<T> RefUnwindSafe for GnsNetworkMessage<T>where
PhantomData<T>: RefUnwindSafe,
impl<T> Unpin for GnsNetworkMessage<T>where
PhantomData<T>: Unpin,
impl<T> UnsafeUnpin for GnsNetworkMessage<T>where
PhantomData<T>: UnsafeUnpin,
impl<T> UnwindSafe for GnsNetworkMessage<T>where
PhantomData<T>: UnwindSafe,
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