Skip to content
Olybear9 edited this page Aug 17, 2021 · 2 revisions

Frame

Modules

Structures

1. Frame

A frame is a series of bytes that contain a header for the reliability of the bytes contained within the frame. A frame is best visualized as a "packet with tracking". Frames contain information needed to verify the that contents can be; decoded, encoded, or ordered. The main point of a frame is to "segment" or "shard" a large packet from the server to the client and vice versa.

Properties

Property Type Description
sequence u64 The frame sequence.
reliable_index u32? The index of the frame (if reliable)
sequence_index u32? The index of the frame (if sequenced)
order_index u32? The ordered index of the frame, this is used to process frames by their "ordered index" when received in bulk.
order_channel u8? The channel (ID) of the ordered frame.
fragment_info FragmentInfo? The fragment information of this frame.
flags u8 The frame flags, used to determine the information above.
reliability Reliability How "reliable" the information in the given frame is.
body BinaryStream The bytes of the frame.

Methods

init()

Creates a Dummy Frame that can be used to be modified later.

fn init() -> Self;
recv(stream) -> Frame

Creates a frame from the given stream.

fn recv(mut stream: BinaryStream) -> Frame
to() -> BinaryStream

Creates a frame from the given stream.

fn recv(mut stream: BinaryStream) -> Frame

2. FramePacket

API

Implementation

Clone this wiki locally