Skip to main content

Handshake

Struct Handshake 

Source
pub struct Handshake<C> { /* private fields */ }
Expand description

The pre-initialized connection state. Consuming initialize makes sending it twice unrepresentable through this API.

Implementations§

Source§

impl<C> Handshake<C>

Source

pub fn new(connection: C) -> Self

Wraps a connection that has not sent initialize yet.

Source§

impl<C: HandshakeConnection> Handshake<C>

Source

pub async fn initialize( self, params: InitializeParams, ) -> Result<Initialized<C>, HandshakeError<C::Error>>

Run initialize exactly once and complete the initialized sequence.

A served fingerprint mismatch is attached to the returned ready state; it never prevents the final notification or discards the connection. To keep the accepted connection after an initialized notify failure, call Self::initialize_preserving_connection.

Source

pub async fn initialize_preserving_connection( self, params: InitializeParams, ) -> Result<Initialized<C>, HandshakeRecoveryError<C, C::Error>>

Run initialize and preserve the accepted connection if initialized fails after the server accepted the request.

Auto Trait Implementations§

§

impl<C> Freeze for Handshake<C>
where C: Freeze,

§

impl<C> RefUnwindSafe for Handshake<C>
where C: RefUnwindSafe,

§

impl<C> Send for Handshake<C>
where C: Send,

§

impl<C> Sync for Handshake<C>
where C: Sync,

§

impl<C> Unpin for Handshake<C>
where C: Unpin,

§

impl<C> UnsafeUnpin for Handshake<C>
where C: UnsafeUnpin,

§

impl<C> UnwindSafe for Handshake<C>
where C: UnwindSafe,

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.

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.