Struct ServerHelloPayload

Source
pub(crate) struct ServerHelloPayload {
    pub(crate) legacy_version: ProtocolVersion,
    pub(crate) random: Random,
    pub(crate) session_id: SessionId,
    pub(crate) cipher_suite: CipherSuite,
    pub(crate) compression_method: Compression,
    pub(crate) extensions: Box<ServerExtensions<'static>>,
}

Fields§

§legacy_version: ProtocolVersion§random: Random§session_id: SessionId§cipher_suite: CipherSuite§compression_method: Compression§extensions: Box<ServerExtensions<'static>>

Implementations§

Source§

impl ServerHelloPayload

Source

fn payload_encode(&self, bytes: &mut Vec<u8>, encoding: Encoding)

Methods from Deref<Target = ServerExtensions<'static>>§

Source

const ALL_EXTENSIONS: &'static [ExtensionType]

Source

fn read_one( &mut self, r: &mut Reader<'a>, unknown: impl FnMut(ExtensionType) -> Result<(), InvalidMessage>, ) -> Result<ExtensionType, InvalidMessage>

Reads one extension typ, length and body from r.

Unhandled extensions (according to read_extension_body() are inserted into unknown_extensions)

Source

fn read_extension_body( &mut self, typ: ExtensionType, r: &mut Reader<'a>, ) -> Result<bool, InvalidMessage>

Reads one extension body for an extension named by typ.

Returns true if handled, false otherwise.

r is fully consumed if typ is unhandled.

Source

fn encode_one(&self, typ: ExtensionType, output: &mut Vec<u8>)

Encode one extension body for typ into output.

Adds nothing to output if typ is absent from this struct, either because it is None or unhandled by this struct.

Source

pub(crate) fn collect_used(&self) -> Vec<ExtensionType>

Return a list of extensions whose items are Some

Source

pub(crate) fn clone_one(&mut self, source: &Self, typ: ExtensionType)

Clone the value of the extension identified by typ from source to self.

Does nothing if typ is not an extension handled by this object.

Source

pub(crate) fn clear(&mut self, typ: ExtensionType)

Remove the extension identified by typ from self.

Source

pub(crate) fn only_contains(&self, allowed: &[ExtensionType]) -> bool

Return true if all present extensions are named in allowed

Source

pub(crate) fn contains_any(&self, exts: &[ExtensionType]) -> bool

Return true if any extension named in exts is present.

Source

fn contains(&self, e: ExtensionType) -> bool

Trait Implementations§

Source§

impl Clone for ServerHelloPayload

Source§

fn clone(&self) -> ServerHelloPayload

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Codec<'_> for ServerHelloPayload

Source§

fn encode(&self, bytes: &mut Vec<u8>)

Function for encoding itself by appending itself to the provided vec of bytes.
Source§

fn read(r: &mut Reader<'_>) -> Result<Self, InvalidMessage>

Function for decoding itself from the provided reader will return Some if the decoding was successful or None if it was not.
Source§

fn get_encoding(&self) -> Vec<u8>

Convenience function for encoding the implementation into a vec and returning it
Source§

fn read_bytes(bytes: &'a [u8]) -> Result<Self, InvalidMessage>

Function for wrapping a call to the read function in a Reader for the slice of bytes provided Read more
Source§

impl Debug for ServerHelloPayload

Source§

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

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

impl Deref for ServerHelloPayload

Source§

type Target = ServerExtensions<'static>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl DerefMut for ServerHelloPayload

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.