pub struct GnsNetworkMessage<T: MayDrop>(/* private fields */);
Expand description
Wrapper around the low-level equivalent. This type is used to implements a more type-safe version of messages.
You will encounter two instances, either GnsNetworkMessage<ToReceive>
or GnsNetworkMessage<ToSend>
.
The former is generated by the library and must be freed unpon handling.
The later is created prior to sending it via the low-level call and the low-level call itself make sure that it is freed.
Implementations§
Source§impl<T> GnsNetworkMessage<T>where
T: MayDrop,
impl<T> GnsNetworkMessage<T>where
T: MayDrop,
Sourcepub unsafe fn into_inner(self) -> *mut ISteamNetworkingMessage
pub unsafe fn into_inner(self) -> *mut ISteamNetworkingMessage
Unsafe function you will highly unlikely use.
pub fn payload(&self) -> &[u8] ⓘ
pub fn message_number(&self) -> u64
pub fn lane(&self) -> GnsLaneId
pub fn flags(&self) -> i32
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_payload(self, payload: &[u8]) -> Self
pub fn set_lane(self, lane: u16) -> Self
pub fn set_flags(self, flags: i32) -> Self
pub fn set_user_data(self, userdata: u64) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for GnsNetworkMessage<T>
impl<T> RefUnwindSafe for GnsNetworkMessage<T>where
T: RefUnwindSafe,
impl<T> !Send for GnsNetworkMessage<T>
impl<T> !Sync for GnsNetworkMessage<T>
impl<T> Unpin for GnsNetworkMessage<T>where
T: Unpin,
impl<T> UnwindSafe for GnsNetworkMessage<T>where
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more