pub struct Credentials {
    pub hostname: String,
    pub port: NonZeroU16,
    pub database: String,
    pub username: String,
    pub password: String,
}Expand description
Credentials for accessing a Postgres database.
This can be used either by accessing it’s fields directly, or by converting
it into a postgres::Config.
let creds = pgpass.query()
    .username("username")?
    .find()?
    .unwrap();
let config: postgres::Config = creds.into();
let db = config.connect(tls)?;Fields§
§hostname: String§port: NonZeroU16§database: String§username: String§password: StringTrait Implementations§
Source§impl Clone for Credentials
 
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
 
fn clone(&self) -> Credentials
Returns a duplicate of the value. Read more
1.0.0 · 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 Credentials
 
impl Debug for Credentials
Source§impl<'de> Deserialize<'de> for Credentials
 
impl<'de> Deserialize<'de> for Credentials
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
 
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
    __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<Credentials> for Config
 
impl From<Credentials> for Config
Source§fn from(value: Credentials) -> Self
 
fn from(value: Credentials) -> Self
Converts to this type from the input type.
Source§impl Hash for Credentials
 
impl Hash for Credentials
Source§impl Ord for Credentials
 
impl Ord for Credentials
Source§fn cmp(&self, other: &Credentials) -> Ordering
 
fn cmp(&self, other: &Credentials) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
    Self: Sized,
 
fn max(self, other: Self) -> Selfwhere
    Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T> PartialEq<Credentials> for CredentialPattern<T>
 
impl<T> PartialEq<Credentials> for CredentialPattern<T>
Source§impl PartialEq for Credentials
 
impl PartialEq for Credentials
Source§impl PartialOrd for Credentials
 
impl PartialOrd for Credentials
Source§impl Serialize for Credentials
 
impl Serialize for Credentials
Source§impl TryFrom<CredentialPattern<HasPasswordTrue>> for Credentials
 
impl TryFrom<CredentialPattern<HasPasswordTrue>> for Credentials
Source§type Error = IncompleteCredential
 
type Error = IncompleteCredential
The type returned in the event of a conversion error.
Source§fn try_from(
    value: CredentialPattern<HasPasswordTrue>,
) -> Result<Self, Self::Error>
 
fn try_from( value: CredentialPattern<HasPasswordTrue>, ) -> Result<Self, Self::Error>
Performs the conversion.
impl Eq for Credentials
impl StructuralPartialEq for Credentials
Auto Trait Implementations§
impl Freeze for Credentials
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnwindSafe for Credentials
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