#[non_exhaustive]pub enum EncodableVersion {
Legacy(ProtocolVersion),
InitialClientHello(Protocol),
}Expand description
A protocol version that can be encoded.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Legacy(ProtocolVersion)
Encode the version in legacy, backward-compatible form.
MUST be set to 0x0303 for all records generated by a TLS 1.3 implementation…
InitialClientHello(Protocol)
Encode the version as an initial client hello, not a retry.
…other than an initial ClientHello (i.e., one not generated after a HelloRetryRequest), where it MAY also be 0x0301 for compatibility purposes.
Implementations§
Source§impl EncodableVersion
impl EncodableVersion
Sourcepub fn encode(&self) -> ProtocolVersion
pub fn encode(&self) -> ProtocolVersion
Encode the protocol version.
Sourcepub fn version(&self) -> ProtocolVersion
pub fn version(&self) -> ProtocolVersion
The actual protocol version in use.
Trait Implementations§
Source§impl Clone for EncodableVersion
impl Clone for EncodableVersion
Source§fn clone(&self) -> EncodableVersion
fn clone(&self) -> EncodableVersion
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for EncodableVersion
Source§impl Debug for EncodableVersion
impl Debug for EncodableVersion
impl Eq for EncodableVersion
Source§impl PartialEq for EncodableVersion
impl PartialEq for EncodableVersion
impl StructuralPartialEq for EncodableVersion
Auto Trait Implementations§
impl Freeze for EncodableVersion
impl RefUnwindSafe for EncodableVersion
impl Send for EncodableVersion
impl Sync for EncodableVersion
impl Unpin for EncodableVersion
impl UnsafeUnpin for EncodableVersion
impl UnwindSafe for EncodableVersion
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more