#[non_exhaustive]pub(crate) struct HelloRetryRequestExtensions<'a> {
pub(crate) key_share: Option<NamedGroup>,
pub(crate) cookie: Option<PayloadU16<NonEmpty>>,
pub(crate) supported_versions: Option<ProtocolVersion>,
pub(crate) encrypted_client_hello: Option<Payload<'a>>,
pub(crate) order: Option<Vec<ExtensionType>>,
}
Expand description
A representation of extensions present in a HelloRetryRequest
message
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.supported_versions: Option<ProtocolVersion>
§encrypted_client_hello: Option<Payload<'a>>
§order: Option<Vec<ExtensionType>>
Records decoding order of records, and controls encoding order.
Implementations§
Source§impl<'a> HelloRetryRequestExtensions<'a>
impl<'a> HelloRetryRequestExtensions<'a>
Sourceconst ALL_EXTENSIONS: &'static [ExtensionType]
const ALL_EXTENSIONS: &'static [ExtensionType]
Every ExtensionType
this structure may encode/decode.
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 read_once<T>(
r: &mut Reader<'a>,
id: ExtensionType,
out: &mut Option<T>,
) -> Result<(), InvalidMessage>where
T: Codec<'a>,
fn read_once<T>(
r: &mut Reader<'a>,
id: ExtensionType,
out: &mut Option<T>,
) -> Result<(), InvalidMessage>where
T: Codec<'a>,
Decode r
as T
into out
, only if out
is None
.
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
Source§impl HelloRetryRequestExtensions<'_>
impl HelloRetryRequestExtensions<'_>
fn into_owned(self) -> HelloRetryRequestExtensions<'static>
Trait Implementations§
Source§impl<'a> Clone for HelloRetryRequestExtensions<'a>
impl<'a> Clone for HelloRetryRequestExtensions<'a>
Source§fn clone(&self) -> HelloRetryRequestExtensions<'a>
fn clone(&self) -> HelloRetryRequestExtensions<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more