Struct GnsNetworkMessage

Source
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,

Source

pub unsafe fn into_inner(self) -> *mut ISteamNetworkingMessage

Unsafe function you will highly unlikely use.

Source

pub fn payload(&self) -> &[u8]

Source

pub fn message_number(&self) -> u64

Source

pub fn lane(&self) -> GnsLaneId

Source

pub fn flags(&self) -> i32

Source

pub fn user_data(&self) -> u64

Source

pub fn connection(&self) -> GnsConnection

Source

pub fn connection_user_data(&self) -> u64

Source§

impl GnsNetworkMessage<ToSend>

Source

pub fn set_connection(self, GnsConnection: GnsConnection) -> Self

Source

pub fn set_payload(self, payload: &[u8]) -> Self

Source

pub fn set_lane(self, lane: u16) -> Self

Source

pub fn set_flags(self, flags: i32) -> Self

Source

pub fn set_user_data(self, userdata: u64) -> Self

Trait Implementations§

Source§

impl<T> Drop for GnsNetworkMessage<T>
where T: MayDrop,

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.