Skip to main content

NegotiatedParams

Struct NegotiatedParams 

Source
pub struct NegotiatedParams {
    pub version: u32,
    pub flags: HandshakeExtensionMessageFlags,
    pub latency_ms: u16,
    pub own_socket_id: u32,
    pub peer_socket_id: u32,
    pub stream_id: Option<String>,
    pub group: Option<GroupMembershipExtension>,
    pub sek: Option<Vec<u8>>,
    pub salt: Option<[u8; 16]>,
}
Expand description

The outcome of a Caller-Listener handshake, once both TSBPD delays and flags have been reconciled per draft-sharabayko-srt-01 §4.3.1.2 (“The value for latency is always agreed to be the greater of those reported by each party”).

Fields§

§version: u32

The negotiated base protocol version — always 5 (HSv5) for a completed handshake in this crate.

§flags: HandshakeExtensionMessageFlags

The flags both sides advertised, ANDed together (only mutually supported capabilities are considered agreed).

§latency_ms: u16

The agreed TSBPD latency in milliseconds: the greater of this side’s configured HandshakeConfig::latency_ms and the peer’s reported Receiver/Sender TSBPD Delay (§4.3.1.2).

§own_socket_id: u32

This side’s own SRT Socket ID.

§peer_socket_id: u32

The peer’s SRT Socket ID.

§stream_id: Option<String>

The negotiated Stream ID (§3.2.1.3), if one was advertised.

§group: Option<GroupMembershipExtension>

The negotiated Group Membership (§3.2.1.4), if one was advertised.

§sek: Option<Vec<u8>>
Available on crate feature crypto only.

The negotiated Stream Encrypting Key (§6.1.5), if HandshakeConfig::crypto was set on this side and the Key Material exchange succeeded. None if encryption was not negotiated.

§salt: Option<[u8; 16]>
Available on crate feature crypto only.

The Salt paired with Self::sek — both are required by crate::crypto::aes_ctr_apply to encrypt/decrypt a data packet’s payload (§6.1.2/§6.2.2/§6.3.2).

Trait Implementations§

Source§

impl Clone for NegotiatedParams

Source§

fn clone(&self) -> NegotiatedParams

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 Debug for NegotiatedParams

Source§

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

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

impl PartialEq for NegotiatedParams

Source§

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

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 NegotiatedParams

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