Struct Finished

Source
pub struct Finished<'b, O, P: ReadPrecision> {
    buffer: &'b mut Buffer<P>,
    output: O,
}
Available on crate features proxy-handshake or client-handshake only.
Expand description

A completed handshake

Represents:

  • Handshake::Output, a value representing the meaning of the completed protocol exchange.
  • Possibly, some data which was received, but didn’t form part of the protocol.

Fields§

§buffer: &'b mut Buffer<P>

The buffer

§output: O

Details of the completed handshake:

Implementations§

Source§

impl<'b, O> Finished<'b, O, PreciseReads>

Source

pub fn into_output(self) -> Result<O, Bug>

Return (just) the output of the completed handshake

Available only if the Buffer was constructed with Buffer::new_precise() (or equivalent).

Source§

impl<'b, O, P: ReadPrecision> Finished<'b, O, P>

Source

pub fn into_output_and_slice(self) -> (O, &'b [u8])

Return the output, and the following already-read data as a slice

(After callin gthis, the following already-read data will no longer be in the Buffer.)

Source

pub fn into_output_and_vec(self) -> (O, Vec<u8>)

Return the output, and the following already-read data as a Vec

The Vec is quite likely to have a considerably larger capacity than contents. (Its capacity is usually the original buffer size, when the Buffer was created.)

The Buffer should not be discarded after calling this; it will not be usable.

Source

pub fn into_output_forbid_pipelining(self) -> Result<O, Error>

Return the output of the completed handshake, declaring any readahead a protocol error

This function is appropriate when the peer is not supposed to send data until the handshake is complete. If data did arrive before then, and was read, we call it a protocol error, Error::ForbiddenPipelining.

Trait Implementations§

Source§

impl<'b, O: Debug, P: Debug + ReadPrecision> Debug for Finished<'b, O, P>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'b, O, P> Freeze for Finished<'b, O, P>
where O: Freeze,

§

impl<'b, O, P> RefUnwindSafe for Finished<'b, O, P>

§

impl<'b, O, P> Send for Finished<'b, O, P>
where O: Send, P: Send,

§

impl<'b, O, P> Sync for Finished<'b, O, P>
where O: Sync, P: Sync,

§

impl<'b, O, P> Unpin for Finished<'b, O, P>
where O: Unpin,

§

impl<'b, O, P> !UnwindSafe for Finished<'b, O, P>

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
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

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
§

impl<T> ErasedDestructor for T
where T: 'static,

§

impl<T> MaybeSendSync for T