pub struct SslMode(/* private fields */);
Expand description
Options controlling the behavior of an SslContext
.
Implementations§
Source§impl SslMode
impl SslMode
Sourcepub const ENABLE_PARTIAL_WRITE: SslMode = _
pub const ENABLE_PARTIAL_WRITE: SslMode = _
Enables “short writes”.
Normally, a write in OpenSSL will always write out all of the requested data, even if it requires more than one TLS record or write to the underlying stream. This option will cause a write to return after writing a single TLS record instead.
Sourcepub const ACCEPT_MOVING_WRITE_BUFFER: SslMode = _
pub const ACCEPT_MOVING_WRITE_BUFFER: SslMode = _
Disables a check that the data buffer has not moved between calls when operating in a nonblocking context.
Sourcepub const AUTO_RETRY: SslMode = _
pub const AUTO_RETRY: SslMode = _
Enables automatic retries after TLS session events such as renegotiations or heartbeats.
By default, OpenSSL will return a WantRead
error after a renegotiation or heartbeat.
This option will cause OpenSSL to automatically continue processing the requested
operation instead.
Note that SslStream::read
and SslStream::write
will automatically retry regardless
of the state of this option. It only affects SslStream::ssl_read
and
SslStream::ssl_write
.
Sourcepub const NO_AUTO_CHAIN: SslMode = _
pub const NO_AUTO_CHAIN: SslMode = _
Disables automatic chain building when verifying a peer’s certificate.
TLS peers are responsible for sending the entire certificate chain from the leaf to a trusted root, but some will incorrectly not do so. OpenSSL will try to build the chain out of certificates it knows of, and this option will disable that behavior.
Sourcepub const RELEASE_BUFFERS: SslMode = _
pub const RELEASE_BUFFERS: SslMode = _
Release memory buffers when the session does not need them.
This saves ~34 KiB of memory for idle streams.
Sourcepub const SEND_FALLBACK_SCSV: SslMode = _
pub const SEND_FALLBACK_SCSV: SslMode = _
Sends the fake TLS_FALLBACK_SCSV
cipher suite in the ClientHello message of a
handshake.
This should only be enabled if a client has failed to connect to a server which attempted to downgrade the protocol version of the session.
Do not use this unless you know what you’re doing!
Source§impl SslMode
impl SslMode
Sourcepub const fn bits(&self) -> u32
pub const fn bits(&self) -> u32
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
Sourcepub const fn from_bits(bits: u32) -> Option<SslMode>
pub const fn from_bits(bits: u32) -> Option<SslMode>
Convert from a bits value.
This method will return None
if any unknown bits are set.
Sourcepub const fn from_bits_truncate(bits: u32) -> SslMode
pub const fn from_bits_truncate(bits: u32) -> SslMode
Convert from a bits value, unsetting any unknown bits.
Sourcepub const fn from_bits_retain(bits: u32) -> SslMode
pub const fn from_bits_retain(bits: u32) -> SslMode
Convert from a bits value exactly.
Sourcepub fn from_name(name: &str) -> Option<SslMode>
pub fn from_name(name: &str) -> Option<SslMode>
Get a flags value with the bits of a flag with the given name set.
This method will return None
if name
is empty or doesn’t
correspond to any named flag.
Sourcepub const fn intersects(&self, other: SslMode) -> bool
pub const fn intersects(&self, other: SslMode) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
Sourcepub const fn contains(&self, other: SslMode) -> bool
pub const fn contains(&self, other: SslMode) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
Sourcepub fn remove(&mut self, other: SslMode)
pub fn remove(&mut self, other: SslMode)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
remove
won’t truncate other
, but the !
operator will.
Sourcepub fn toggle(&mut self, other: SslMode)
pub fn toggle(&mut self, other: SslMode)
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub fn set(&mut self, other: SslMode, value: bool)
pub fn set(&mut self, other: SslMode, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
Sourcepub const fn intersection(self, other: SslMode) -> SslMode
pub const fn intersection(self, other: SslMode) -> SslMode
The bitwise and (&
) of the bits in two flags values.
Sourcepub const fn union(self, other: SslMode) -> SslMode
pub const fn union(self, other: SslMode) -> SslMode
The bitwise or (|
) of the bits in two flags values.
Sourcepub const fn difference(self, other: SslMode) -> SslMode
pub const fn difference(self, other: SslMode) -> SslMode
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
Sourcepub const fn symmetric_difference(self, other: SslMode) -> SslMode
pub const fn symmetric_difference(self, other: SslMode) -> SslMode
The bitwise exclusive-or (^
) of the bits in two flags values.
Sourcepub const fn complement(self) -> SslMode
pub const fn complement(self) -> SslMode
The bitwise negation (!
) of the bits in a flags value, truncating the result.
Source§impl SslMode
impl SslMode
Sourcepub const fn iter(&self) -> Iter<SslMode>
pub const fn iter(&self) -> Iter<SslMode>
Yield a set of contained flags values.
Each yielded flags value will correspond to a defined named flag. Any unknown bits will be yielded together as a final flags value.
Sourcepub const fn iter_names(&self) -> IterNames<SslMode>
pub const fn iter_names(&self) -> IterNames<SslMode>
Yield a set of contained named flags values.
This method is like iter
, except only yields bits in contained named flags.
Any unknown bits, or bits not corresponding to a contained flag will not be yielded.
Trait Implementations§
Source§impl BitAndAssign for SslMode
impl BitAndAssign for SslMode
Source§fn bitand_assign(&mut self, other: SslMode)
fn bitand_assign(&mut self, other: SslMode)
The bitwise and (&
) of the bits in two flags values.
Source§impl BitOrAssign for SslMode
impl BitOrAssign for SslMode
Source§fn bitor_assign(&mut self, other: SslMode)
fn bitor_assign(&mut self, other: SslMode)
The bitwise or (|
) of the bits in two flags values.
Source§impl BitXorAssign for SslMode
impl BitXorAssign for SslMode
Source§fn bitxor_assign(&mut self, other: SslMode)
fn bitxor_assign(&mut self, other: SslMode)
The bitwise exclusive-or (^
) of the bits in two flags values.
Source§impl Extend<SslMode> for SslMode
impl Extend<SslMode> for SslMode
Source§fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = SslMode>,
fn extend<T>(&mut self, iterator: T)where
T: IntoIterator<Item = SslMode>,
The bitwise or (|
) of the bits in each flags value.
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl Flags for SslMode
impl Flags for SslMode
Source§fn from_bits_retain(bits: u32) -> SslMode
fn from_bits_retain(bits: u32) -> SslMode
Source§fn from_bits_truncate(bits: Self::Bits) -> Self
fn from_bits_truncate(bits: Self::Bits) -> Self
Source§fn from_name(name: &str) -> Option<Self>
fn from_name(name: &str) -> Option<Self>
Source§fn iter_names(&self) -> IterNames<Self>
fn iter_names(&self) -> IterNames<Self>
Source§fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
fn intersects(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn contains(&self, other: Self) -> boolwhere
Self: Sized,
fn contains(&self, other: Self) -> boolwhere
Self: Sized,
Source§fn insert(&mut self, other: Self)where
Self: Sized,
fn insert(&mut self, other: Self)where
Self: Sized,
|
) of the bits in two flags values.Source§fn remove(&mut self, other: Self)where
Self: Sized,
fn remove(&mut self, other: Self)where
Self: Sized,
&!
). Read moreSource§fn toggle(&mut self, other: Self)where
Self: Sized,
fn toggle(&mut self, other: Self)where
Self: Sized,
^
) of the bits in two flags values.Source§fn intersection(self, other: Self) -> Self
fn intersection(self, other: Self) -> Self
&
) of the bits in two flags values.Source§fn difference(self, other: Self) -> Self
fn difference(self, other: Self) -> Self
&!
). Read moreSource§fn symmetric_difference(self, other: Self) -> Self
fn symmetric_difference(self, other: Self) -> Self
^
) of the bits in two flags values.Source§fn complement(self) -> Self
fn complement(self) -> Self
!
) of the bits in a flags value, truncating the result.Source§impl FromIterator<SslMode> for SslMode
impl FromIterator<SslMode> for SslMode
Source§impl IntoIterator for SslMode
impl IntoIterator for SslMode
Source§impl Ord for SslMode
impl Ord for SslMode
Source§impl PartialOrd for SslMode
impl PartialOrd for SslMode
Source§impl Sub for SslMode
impl Sub for SslMode
Source§impl SubAssign for SslMode
impl SubAssign for SslMode
Source§fn sub_assign(&mut self, other: SslMode)
fn sub_assign(&mut self, other: SslMode)
The intersection of a source flags value with the complement of a target flags value (&!
).
This method is not equivalent to self & !other
when other
has unknown bits set.
difference
won’t truncate other
, but the !
operator will.
impl Copy for SslMode
impl Eq for SslMode
impl StructuralPartialEq for SslMode
Auto Trait Implementations§
impl Freeze for SslMode
impl RefUnwindSafe for SslMode
impl Send for SslMode
impl Sync for SslMode
impl Unpin for SslMode
impl UnwindSafe for SslMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)