[−][src]Struct srt_protocol::packet::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|K K|R| Message Number | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Time Stamp | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Destination Socket ID | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Fields
seq_number: SeqNumberThe 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: PacketLocationMessage location and delivery order Represented by the first two bits in the second row of 4 bytes
in_order_delivery: boolIn order delivery, the third bit in the second row of 4 bytes
encryption: DataEncryptionrow 2 bits 4+5, which key it's encrypted with, if it is
retransmitted: boolmessage_number: MsgNumberThe message number, is the ID of the message being passed Represented by the final 26 bits of the third row It's only 26 bits long, so it's wrapped after 2^26 - 1
timestamp: TimeStampThe timestamp, relative to when the connection was created.
dest_sockid: SocketIDThe dest socket id, used for UDP multiplexing
payload: BytesThe 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]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl Debug for DataPacket[src]
impl Eq for DataPacket[src]
impl From<DataPacket> for Packet[src]
fn from(dp: DataPacket) -> Self[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[src]
impl Send for DataPacket[src]
impl Sync for DataPacket[src]
impl Unpin for DataPacket[src]
impl UnwindSafe for DataPacket[src]
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,
pub 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> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub 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.
pub 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.
pub 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>,