Struct ENetPacket

Source
#[repr(C)]
pub struct ENetPacket { pub referenceCount: size_t, pub flag: enet_uint32, pub data: *mut enet_uint8, pub dataLength: size_t, pub freeCallback: ENetPacketFreeCallback, pub userData: *mut c_void, }
Expand description

ENet packet structure.

An ENet data packet that may be sent to or received from a peer. The shown fields should only be read and never modified. The data field contains the allocated data for the packet. The dataLength fields specifies the length of the allocated data. The flags field is either 0 (specifying no flags), or a bitwise-or of any combination of the following flags:

ENET_PACKET_FLAG_RELIABLE - packet must be received by the target peer and resend attempts should be made until the packet is delivered

ENET_PACKET_FLAG_UNSEQUENCED - packet will not be sequenced with other packets (not supported for reliable packets)

ENET_PACKET_FLAG_NO_ALLOCATE - packet will not allocate data, and user must supply it instead

ENET_PACKET_FLAG_UNRELIABLE_FRAGMENT - packet will be fragmented using unreliable (instead of reliable) sends if it exceeds the MTU

ENET_PACKET_FLAG_SENT - whether the packet has been sent from all queues it has been entered into

ENetPacketFlag

Fields§

§referenceCount: size_t

internal use only

§flag: enet_uint32

bitwise-or of ENetPacketFlag constants

§data: *mut enet_uint8

allocated data for packet

§dataLength: size_t

length of data

§freeCallback: ENetPacketFreeCallback

function to be called when the packet is no longer in use

§userData: *mut c_void

application private data, may be freely modified

Trait Implementations§

Source§

impl Debug for ENetPacket

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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