pub enum PostgresSslMode {
Disable,
Prefer,
Require,
VerifyFull,
}Expand description
How much transport security a PostgreSQL connection must have.
See this module’s documentation for the meaning of each rung, and for why libpq’s
allow and verify-ca are refused rather than approximated.
Variants§
Disable
Never negotiate TLS; connect in cleartext.
Prefer
Negotiate TLS when the server offers it, fall back to cleartext otherwise.
The default, and libpq’s. Does not authenticate the server.
Require
Require TLS; fail if the server cannot provide it. Does not authenticate
the server — use VerifyFull for that.
VerifyFull
Require TLS and verify the server’s certificate chain and hostname.
Implementations§
Source§impl PostgresSslMode
impl PostgresSslMode
Sourcepub const fn as_str(self) -> &'static str
pub const fn as_str(self) -> &'static str
The spelling used in configuration files and connection URLs.
Sourcepub const fn verifies_server(self) -> bool
pub const fn verifies_server(self) -> bool
Whether this mode authenticates the server it connects to.
Sourcepub const fn requires_encryption(self) -> bool
pub const fn requires_encryption(self) -> bool
Whether this mode refuses to fall back to cleartext.
Trait Implementations§
Source§impl Clone for PostgresSslMode
impl Clone for PostgresSslMode
Source§fn clone(&self) -> PostgresSslMode
fn clone(&self) -> PostgresSslMode
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 PostgresSslMode
Source§impl Debug for PostgresSslMode
impl Debug for PostgresSslMode
Source§impl Default for PostgresSslMode
impl Default for PostgresSslMode
Source§fn default() -> PostgresSslMode
fn default() -> PostgresSslMode
Source§impl Display for PostgresSslMode
impl Display for PostgresSslMode
impl Eq for PostgresSslMode
Source§impl FromStr for PostgresSslMode
impl FromStr for PostgresSslMode
Source§fn from_str(s: &str) -> Result<PostgresSslMode, FraiseQLError>
fn from_str(s: &str) -> Result<PostgresSslMode, FraiseQLError>
Parse a libpq ssl-mode spelling.
§Errors
Returns FraiseQLError::Configuration for an unknown mode, and for the
two libpq modes this driver cannot honour (allow, verify-ca) — each with
a message naming the mode to use instead. Silently downgrading either one
would reintroduce the defect this module exists to fix.
Source§type Err = FraiseQLError
type Err = FraiseQLError
Source§impl PartialEq for PostgresSslMode
impl PartialEq for PostgresSslMode
impl StructuralPartialEq for PostgresSslMode
Auto Trait Implementations§
impl Freeze for PostgresSslMode
impl RefUnwindSafe for PostgresSslMode
impl Send for PostgresSslMode
impl Sync for PostgresSslMode
impl Unpin for PostgresSslMode
impl UnsafeUnpin for PostgresSslMode
impl UnwindSafe for PostgresSslMode
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.