#[non_exhaustive]pub(crate) struct ServerExtensions<'a> {Show 17 fields
pub(crate) ec_point_formats: Option<SupportedEcPointFormats>,
pub(crate) server_name_ack: Option<()>,
pub(crate) session_ticket_ack: Option<()>,
pub(crate) renegotiation_info: Option<PayloadU8>,
pub(crate) selected_protocol: Option<SingleProtocolName>,
pub(crate) key_share: Option<KeyShareEntry>,
pub(crate) preshared_key: Option<u16>,
pub(crate) client_certificate_type: Option<CertificateType>,
pub(crate) server_certificate_type: Option<CertificateType>,
pub(crate) extended_master_secret_ack: Option<()>,
pub(crate) certificate_status_request_ack: Option<()>,
pub(crate) selected_version: Option<ProtocolVersion>,
pub(crate) transport_parameters: Option<Payload<'a>>,
pub(crate) transport_parameters_draft: Option<Payload<'a>>,
pub(crate) early_data_ack: Option<()>,
pub(crate) encrypted_client_hello_ack: Option<ServerEncryptedClientHello>,
pub(crate) unknown_extensions: BTreeSet<u16>,
}
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.ec_point_formats: Option<SupportedEcPointFormats>
Supported EC point formats (RFC4492)
server_name_ack: Option<()>
Server name indication acknowledgement (RFC6066)
session_ticket_ack: Option<()>
Session ticket acknowledgement (RFC5077)
renegotiation_info: Option<PayloadU8>
§selected_protocol: Option<SingleProtocolName>
Selected ALPN protocol (RFC7301)
Key exchange server share (RFC8446)
Selected preshared key index (RFC8446)
client_certificate_type: Option<CertificateType>
Required client certificate type (RFC7250)
server_certificate_type: Option<CertificateType>
Selected server certificate type (RFC7250)
extended_master_secret_ack: Option<()>
Extended master secret is in use (RFC7627)
certificate_status_request_ack: Option<()>
Certificate status acknowledgement (RFC6066)
selected_version: Option<ProtocolVersion>
Selected TLS version (RFC8446)
transport_parameters: Option<Payload<'a>>
QUIC transport parameters (RFC9001)
transport_parameters_draft: Option<Payload<'a>>
QUIC transport parameters (RFC9001 prior to draft 33)
early_data_ack: Option<()>
Early data is accepted (RFC8446)
encrypted_client_hello_ack: Option<ServerEncryptedClientHello>
Encrypted inner client hello response (draft-ietf-tls-esni)
unknown_extensions: BTreeSet<u16>
Implementations§
Source§impl<'a> ServerExtensions<'a>
impl<'a> ServerExtensions<'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 ServerExtensions<'_>
impl ServerExtensions<'_>
fn into_owned(self) -> ServerExtensions<'static>
Trait Implementations§
Source§impl<'a> Clone for ServerExtensions<'a>
impl<'a> Clone for ServerExtensions<'a>
Source§fn clone(&self) -> ServerExtensions<'a>
fn clone(&self) -> ServerExtensions<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more