#[non_exhaustive]#[repr(u8)]pub enum EncryptionLevel {
Off = 0,
On = 1,
NotSupported = 2,
Required = 3,
ClientCertAuth = 128,
ClientCertOn = 129,
ClientCertReq = 131,
}Expand description
Encryption level for connection.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Off = 0
Encryption is off.
On = 1
Encryption is on.
NotSupported = 2
Encryption is not supported.
Required = 3
Encryption is required.
ClientCertAuth = 128
Client certificate authentication, base level off
(ENCRYPT_CLIENT_CERT | ENCRYPT_OFF, TDS 8.0+).
ENCRYPT_CLIENT_CERT (0x80) is a flag OR’d onto the base encryption
level, so it appears combined with on/required as well (see
Self::ClientCertOn / Self::ClientCertReq).
ClientCertOn = 129
Client certificate authentication with encryption on
(ENCRYPT_CLIENT_CERT | ENCRYPT_ON, TDS 8.0+).
ClientCertReq = 131
Client certificate authentication with encryption required
(ENCRYPT_CLIENT_CERT | ENCRYPT_REQ, TDS 8.0+).
Implementations§
Source§impl EncryptionLevel
impl EncryptionLevel
Sourcepub fn from_u8(value: u8) -> Result<Self, ProtocolError>
pub fn from_u8(value: u8) -> Result<Self, ProtocolError>
Create from a raw byte value.
Returns an error for an unrecognized byte rather than defaulting to
Self::Off: a garbage or unexpected encryption byte from the server
must not be silently read as “encryption off”, which would mask a
downgrade or a malformed PRELOGIN response (#278). Mirrors the fallible
PreLoginOption::from_u8.
Sourcepub const fn is_required(&self) -> bool
pub const fn is_required(&self) -> bool
Check if encryption is required.
Trait Implementations§
Source§impl Clone for EncryptionLevel
impl Clone for EncryptionLevel
Source§fn clone(&self) -> EncryptionLevel
fn clone(&self) -> EncryptionLevel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for EncryptionLevel
Source§impl Debug for EncryptionLevel
impl Debug for EncryptionLevel
Source§impl Default for EncryptionLevel
impl Default for EncryptionLevel
Source§fn default() -> EncryptionLevel
fn default() -> EncryptionLevel
impl Eq for EncryptionLevel
Source§impl PartialEq for EncryptionLevel
impl PartialEq for EncryptionLevel
Source§fn eq(&self, other: &EncryptionLevel) -> bool
fn eq(&self, other: &EncryptionLevel) -> bool
self and other values to be equal, and is used by ==.