Struct eugene::pgpass::PgPassFile
source · pub struct PgPassFile { /* private fields */ }Expand description
Represents the contents of a pgpass file, see https://www.postgresql.org/docs/current/libpq-pgpass.html
Implementations§
source§impl PgPassFile
impl PgPassFile
sourcepub fn find_password(
&self,
host: &str,
port: u16,
database: &str,
user: &str
) -> Option<&str>
pub fn find_password( &self, host: &str, port: u16, database: &str, user: &str ) -> Option<&str>
Find the password for a given host, port, database and user
Will always return the password for the first matching pgpass line, if there are overlapping rules, only the first password will be returned
Trait Implementations§
source§impl Clone for PgPassFile
impl Clone for PgPassFile
source§fn clone(&self) -> PgPassFile
fn clone(&self) -> PgPassFile
Returns a copy 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 PgPassFile
impl Debug for PgPassFile
source§impl PartialEq for PgPassFile
impl PartialEq for PgPassFile
source§fn eq(&self, other: &PgPassFile) -> bool
fn eq(&self, other: &PgPassFile) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl Eq for PgPassFile
impl StructuralPartialEq for PgPassFile
Auto Trait Implementations§
impl Freeze for PgPassFile
impl RefUnwindSafe for PgPassFile
impl Send for PgPassFile
impl Sync for PgPassFile
impl Unpin for PgPassFile
impl UnwindSafe for PgPassFile
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
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 more