Skip to main content

SplitConnection

Struct SplitConnection 

Source
pub struct SplitConnection<Side: SideData> {
    pub send: SendTraffic,
    pub receive: ReceiveTraffic<Side>,
    pub outputs: ConnectionOutputs,
}
Expand description

A post-handshake connection which has been split by direction.

Typically you will immediately destructure this type, and give the components to different threads/handlers to progress separately.

Fields§

§send: SendTraffic

The ability to encrypt data to be sent.

§receive: ReceiveTraffic<Side>

The ability to decrypt received data.

§outputs: ConnectionOutputs

Facts about the connection established during the handshake.

Implementations§

Source§

impl<Side: SideData> SplitConnection<Side>

Source

pub fn dangerous_into_kernel_connection( self, ) -> Result<(ExtractedSecrets, KernelConnection<Side>), Error>

Extract secrets and a KernelConnection, so they can be used when configuring kTLS, for example.

Should be used with care as it exposes secret key material.

The returned KernelConnection continues to own the connection’s secrets, so it can compute new traffic secrets on key update and (for client connections) accept session tickets. See the kernel module documentation for the details.

This fails if the connection was not made with enable_secret_extraction set.

Trait Implementations§

Source§

impl<Side: Debug + SideData> Debug for SplitConnection<Side>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<Side> !RefUnwindSafe for SplitConnection<Side>

§

impl<Side> !UnwindSafe for SplitConnection<Side>

§

impl<Side> Freeze for SplitConnection<Side>
where <Side as Side>::State: Freeze,

§

impl<Side> Send for SplitConnection<Side>
where <Side as Side>::State: Send,

§

impl<Side> Sync for SplitConnection<Side>
where <Side as Side>::State: Sync,

§

impl<Side> Unpin for SplitConnection<Side>
where <Side as Side>::State: Unpin,

§

impl<Side> UnsafeUnpin for SplitConnection<Side>
where <Side as Side>::State: UnsafeUnpin,

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, 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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more