Skip to main content

RejectionReason

Enum RejectionReason 

Source
#[non_exhaustive]
pub enum RejectionReason {
Show 17 variants Unknown, System, Peer, Resource, Rogue, Backlog, Ipe, Close, Version, RdvCookie, BadSecret, Unsecure, MessageApi, Congestion, Filter, Group, Reserved(u32),
}
Expand description

Handshake Rejection Reason (draft-sharabayko-srt-01 §4.3, Table 7). Sent in place of a normal Handshake Type value (1000 + code, decoded via HandshakeType::Reserved) when a connection attempt is refused.

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.
§

Unknown

1000: unknown reason.

§

System

1001: system function error.

§

Peer

1002: rejected by peer.

§

Resource

1003: resource allocation problem.

§

Rogue

1004: incorrect data in handshake.

§

Backlog

1005: listener’s backlog exceeded.

§

Ipe

1006: internal program error.

§

Close

1007: socket is closing.

§

Version

1008: peer is an older version than the agent’s minimum.

§

RdvCookie

1009: rendezvous cookie collision.

§

BadSecret

1010: wrong password.

§

Unsecure

1011: password required or unexpected.

§

MessageApi

1012: stream flag collision.

§

Congestion

1013: incompatible congestion-controller type.

§

Filter

1014: incompatible packet filter.

§

Group

1015: incompatible group.

§

Reserved(u32)

A 1000 + code value Table 7 does not define.

Implementations§

Source§

impl RejectionReason

Source

pub fn from_bits(v: u32) -> Self

Decode a Table 7 wire code (the value carried in Handshake Type, i.e. already 1000 + code).

Source

pub fn to_bits(self) -> u32

The wire code (1000 + code), as carried in Handshake Type.

Source

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

Spec label (Table 7).

Source

pub fn from_handshake_type(ht: HandshakeType) -> Option<Self>

Recover the RejectionReason a peer sent back as a Handshake Type, or None if ht is a normal (non-rejection) handshake type.

Source

pub fn to_handshake_type(self) -> HandshakeType

Encode as the Handshake Type value a rejection packet carries.

Trait Implementations§

Source§

impl Clone for RejectionReason

Source§

fn clone(&self) -> RejectionReason

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 RejectionReason

Source§

impl Debug for RejectionReason

Source§

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

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

impl Display for RejectionReason

Source§

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

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

impl Eq for RejectionReason

Source§

impl Hash for RejectionReason

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 RejectionReason

Source§

fn eq(&self, other: &RejectionReason) -> 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 RejectionReason

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 RejectionReason

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.