pub struct PacketInfo<'a> {
pub packet_type: PacketType,
pub payload: &'a [u8],
pub delivery: DeliveryGuarantee,
pub ordering: OrderingGuarantee,
}Expand description
Non-owning packet metadata used during processing.
Fields§
§packet_type: PacketTypeType of packet (user data, heartbeat, fragment, etc.)
payload: &'a [u8]Reference to the packet payload
delivery: DeliveryGuaranteeDelivery guarantee for this packet
ordering: OrderingGuaranteeOrdering guarantee for this packet
Implementations§
Source§impl<'a> PacketInfo<'a>
impl<'a> PacketInfo<'a>
Sourcepub fn user_packet(
payload: &'a [u8],
delivery: DeliveryGuarantee,
ordering: OrderingGuarantee,
) -> PacketInfo<'a>
pub fn user_packet( payload: &'a [u8], delivery: DeliveryGuarantee, ordering: OrderingGuarantee, ) -> PacketInfo<'a>
Creates packet info for user data with specified guarantees.
Sourcepub fn heartbeat_packet(payload: &'a [u8]) -> PacketInfo<'a>
pub fn heartbeat_packet(payload: &'a [u8]) -> PacketInfo<'a>
Creates packet info for a heartbeat/keepalive packet.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for PacketInfo<'a>
impl<'a> RefUnwindSafe for PacketInfo<'a>
impl<'a> Send for PacketInfo<'a>
impl<'a> Sync for PacketInfo<'a>
impl<'a> Unpin for PacketInfo<'a>
impl<'a> UnwindSafe for PacketInfo<'a>
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