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: Self = _
pub const ENABLE_PARTIAL_WRITE: Self = _
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: Self = _
pub const ACCEPT_MOVING_WRITE_BUFFER: Self = _
Disables a check that the data buffer has not moved between calls when operating in a non-blocking context.
sourcepub const AUTO_RETRY: Self = _
pub const AUTO_RETRY: Self = _
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: Self = _
pub const NO_AUTO_CHAIN: Self = _
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: Self = _
pub const RELEASE_BUFFERS: Self = _
Release memory buffers when the session does not need them.
This saves ~34 KiB of memory for idle streams.
sourcepub const SEND_FALLBACK_SCSV: Self = _
pub const SEND_FALLBACK_SCSV: Self = _
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) -> c_long
pub const fn bits(&self) -> c_long
Get the underlying bits value.
The returned value is exactly the bits set in this flags value.
sourcepub const fn from_bits(bits: c_long) -> Option<Self>
pub const fn from_bits(bits: c_long) -> Option<Self>
Convert from a bits value.
This method will return None
if any unknown bits are set.
sourcepub const fn from_bits_truncate(bits: c_long) -> Self
pub const fn from_bits_truncate(bits: c_long) -> Self
Convert from a bits value, unsetting any unknown bits.
sourcepub const fn from_bits_retain(bits: c_long) -> Self
pub const fn from_bits_retain(bits: c_long) -> Self
Convert from a bits value exactly.
sourcepub fn from_name(name: &str) -> Option<Self>
pub fn from_name(name: &str) -> Option<Self>
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: Self) -> bool
pub const fn intersects(&self, other: Self) -> bool
Whether any set bits in a source flags value are also set in a target flags value.
sourcepub const fn contains(&self, other: Self) -> bool
pub const fn contains(&self, other: Self) -> bool
Whether all set bits in a source flags value are also set in a target flags value.
sourcepub fn remove(&mut self, other: Self)
pub fn remove(&mut self, other: Self)
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: Self)
pub fn toggle(&mut self, other: Self)
The bitwise exclusive-or (^
) of the bits in two flags values.
sourcepub fn set(&mut self, other: Self, value: bool)
pub fn set(&mut self, other: Self, value: bool)
Call insert
when value
is true
or remove
when value
is false
.
sourcepub const fn intersection(self, other: Self) -> Self
pub const fn intersection(self, other: Self) -> Self
The bitwise and (&
) of the bits in two flags values.
sourcepub const fn union(self, other: Self) -> Self
pub const fn union(self, other: Self) -> Self
The bitwise or (|
) of the bits in two flags values.
sourcepub const fn difference(self, other: Self) -> Self
pub const fn difference(self, other: Self) -> Self
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: Self) -> Self
pub const fn symmetric_difference(self, other: Self) -> Self
The bitwise exclusive-or (^
) of the bits in two flags values.
sourcepub const fn complement(self) -> Self
pub const fn complement(self) -> Self
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: Self)
fn bitand_assign(&mut self, other: Self)
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: Self)
fn bitor_assign(&mut self, other: Self)
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: Self)
fn bitxor_assign(&mut self, other: Self)
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: IntoIterator<Item = Self>>(&mut self, iterator: T)
fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)
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: c_long) -> SslMode
fn from_bits_retain(bits: c_long) -> 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§fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self
The bitwise or (|
) of the bits in each flags value.
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: Self)
fn sub_assign(&mut self, other: Self)
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)