Skip to main content

ControlType

Enum ControlType 

Source
#[non_exhaustive]
pub enum ControlType { Handshake, KeepAlive, Ack, Nak, CongestionWarning, Shutdown, AckAck, DropReq, PeerError, UserDefined, Reserved(u16), }
Expand description

The Control Type field (draft-sharabayko-srt-01 §3.2, Table 1) — 15 bits.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Handshake

0x0000 — Handshake (§3.2.1).

§

KeepAlive

0x0001 — Keep-Alive (§3.2.3).

§

Ack

0x0002 — ACK (§3.2.4).

§

Nak

0x0003 — NAK / Loss Report (§3.2.5).

§

CongestionWarning

0x0004 — Congestion Warning (§3.2.6).

§

Shutdown

0x0005 — Shutdown (§3.2.7).

§

AckAck

0x0006 — ACKACK (§3.2.8).

§

DropReq

0x0007 — Message Drop Request (§3.2.9).

§

PeerError

0x0008 — Peer Error (§3.2.10).

§

UserDefined

0x7FFF — User-Defined Type (also the Key Material control-packet delivery form, §3.2.2).

§

Reserved(u16)

A Control Type value Table 1 does not define.

Implementations§

Source§

impl ControlType

Source

pub fn from_bits(v: u16) -> Self

Decode a 15-bit Control Type value.

Source

pub fn to_bits(self) -> u16

The wire value.

Source

pub fn name(&self) -> &'static str

Spec label.

Trait Implementations§

Source§

impl Clone for ControlType

Source§

fn clone(&self) -> ControlType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ControlType

Source§

impl Debug for ControlType

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for ControlType

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for ControlType

Source§

impl Hash for ControlType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for ControlType

Source§

fn eq(&self, other: &ControlType) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ControlType

Available on crate feature serde only.
Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ControlType

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.