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
impl ServerHelloPayload
fn payload_encode(&self, bytes: &mut Vec<u8>, encoding: Encoding)
Methods from Deref<Target = ServerExtensions<'static>>§
const ALL_EXTENSIONS: &'static [ExtensionType]
Sourcefn read_one(
&mut self,
r: &mut Reader<'a>,
unknown: impl FnMut(ExtensionType) -> Result<(), InvalidMessage>,
) -> Result<ExtensionType, InvalidMessage>
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
)
Sourcefn read_extension_body(
&mut self,
typ: ExtensionType,
r: &mut Reader<'a>,
) -> Result<bool, InvalidMessage>
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.
Sourcefn encode_one(&self, typ: ExtensionType, output: &mut Vec<u8>)
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.
Sourcepub(crate) fn collect_used(&self) -> Vec<ExtensionType>
pub(crate) fn collect_used(&self) -> Vec<ExtensionType>
Return a list of extensions whose items are Some
Sourcepub(crate) fn clone_one(&mut self, source: &Self, typ: ExtensionType)
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.
Sourcepub(crate) fn clear(&mut self, typ: ExtensionType)
pub(crate) fn clear(&mut self, typ: ExtensionType)
Remove the extension identified by typ
from self
.
Sourcepub(crate) fn only_contains(&self, allowed: &[ExtensionType]) -> bool
pub(crate) fn only_contains(&self, allowed: &[ExtensionType]) -> bool
Return true if all present extensions are named in allowed
Sourcepub(crate) fn contains_any(&self, exts: &[ExtensionType]) -> bool
pub(crate) fn contains_any(&self, exts: &[ExtensionType]) -> bool
Return true if any extension named in exts
is present.
fn contains(&self, e: ExtensionType) -> bool
Trait Implementations§
Source§impl Clone for ServerHelloPayload
impl Clone for ServerHelloPayload
Source§fn clone(&self) -> ServerHelloPayload
fn clone(&self) -> ServerHelloPayload
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more