Struct gns::GnsNetworkMessage
source · [−]#[repr(transparent)]pub struct GnsNetworkMessage<T: MayDrop>(_, _);
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
sourceimpl<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]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn message_number(&self) -> u64
pub fn lane(&self) -> GnsLaneId
pub fn flags(&self) -> u32
pub fn user_data(&self) -> u64
pub fn connection(&self) -> GnsConnection
pub fn connection_user_data(&self) -> u64
sourceimpl 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> 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
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