[−][src]Struct srt::DataPacket
A UDT packet carrying data
0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |0| Packet Sequence Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |FF |O| Message Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time Stamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Socket ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Fields
seq_number: SeqNumber
The sequence number is packet based, so if packet n has
sequence number i
, the next would have i + 1
Represented by a 31 bit unsigned integer, so
Sequence number is wrapped after it recahed 2^31 - 1
message_loc: PacketLocation
Message location and delivery order Represented by the first two bits in the second row of 4 bytes
in_order_delivery: bool
In order delivery, the third bit in the second row of 4 bytes
message_number: MsgNumber
The message number, is the ID of the message being passed Represented by the final 29 bits of the third row It's only 29 bits long, so it's wrapped after 2^29 - 1
timestamp: TimeStamp
The timestamp, relative to when the connection was created.
dest_sockid: SocketID
The dest socket id, used for UDP multiplexing
payload: Bytes
The rest of the packet, the payload
Implementations
impl DataPacket
[src]
pub fn parse(buf: &mut impl Buf) -> Result<DataPacket, PacketParseError>
[src]
pub fn serialize(&self, into: &mut impl BufMut)
[src]
Trait Implementations
impl Clone for DataPacket
[src]
fn clone(&self) -> DataPacket
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for DataPacket
[src]
impl Eq for DataPacket
[src]
impl PartialEq<DataPacket> for DataPacket
[src]
fn eq(&self, other: &DataPacket) -> bool
[src]
fn ne(&self, other: &DataPacket) -> bool
[src]
impl StructuralEq for DataPacket
[src]
impl StructuralPartialEq for DataPacket
[src]
Auto Trait Implementations
impl RefUnwindSafe for DataPacket
impl Send for DataPacket
impl Sync for DataPacket
impl Unpin for DataPacket
impl UnwindSafe for DataPacket
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,