pub struct PostgresTlsPolicy { /* private fields */ }Expand description
A complete Postgres TLS policy.
The fields are private so callers cannot pair plaintext with CA roots or construct
verify-ca without a root. Cloning the policy is cheap: certificate bundles are
reference-counted and copied only when crossing an FFI boundary.
Implementations§
Source§impl PostgresTlsPolicy
impl PostgresTlsPolicy
Sourcepub fn verify_ca(
ca_certificates: Vec<String>,
) -> Result<Self, InvalidPostgresCaCertificates>
pub fn verify_ca( ca_certificates: Vec<String>, ) -> Result<Self, InvalidPostgresCaCertificates>
TLS with CA verification but no hostname verification.
This mode requires at least one valid PEM root.
Sourcepub fn verify_full(
ca_certificates: Vec<String>,
) -> Result<Self, InvalidPostgresCaCertificates>
pub fn verify_full( ca_certificates: Vec<String>, ) -> Result<Self, InvalidPostgresCaCertificates>
TLS with CA and hostname verification.
An empty root set intentionally selects the runtime’s system trust store.
Sourcepub fn verify_full_with_system_roots() -> Self
pub fn verify_full_with_system_roots() -> Self
TLS with CA and hostname verification using the runtime’s system trust store.
Sourcepub fn sslmode(&self) -> SslMode
pub fn sslmode(&self) -> SslMode
The libpq-compatible sslmode represented by this complete policy.
Sourcepub fn ca_certificates(&self) -> &[String]
pub fn ca_certificates(&self) -> &[String]
PEM-encoded roots, or an empty slice when this policy uses no roots or the runtime’s system trust store.
Trait Implementations§
Source§impl Clone for PostgresTlsPolicy
impl Clone for PostgresTlsPolicy
Source§fn clone(&self) -> PostgresTlsPolicy
fn clone(&self) -> PostgresTlsPolicy
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 moreSource§impl Debug for PostgresTlsPolicy
impl Debug for PostgresTlsPolicy
impl Eq for PostgresTlsPolicy
Source§impl PartialEq for PostgresTlsPolicy
impl PartialEq for PostgresTlsPolicy
impl StructuralPartialEq for PostgresTlsPolicy
Auto Trait Implementations§
impl Freeze for PostgresTlsPolicy
impl RefUnwindSafe for PostgresTlsPolicy
impl Send for PostgresTlsPolicy
impl Sync for PostgresTlsPolicy
impl Unpin for PostgresTlsPolicy
impl UnsafeUnpin for PostgresTlsPolicy
impl UnwindSafe for PostgresTlsPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
key and return true if they are equal.Source§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
Source§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.