pub struct DatabaseCredential {
pub username: String,
pub password: String,
pub database: Option<String>,
pub host: Option<String>,
pub port: Option<u16>,
pub options: HashMap<String, String>,
pub expires_at: Option<DateTime<Utc>>,
pub source: CredentialSource,
}Expand description
Database credential
Fields§
§username: StringUsername
password: StringPassword
database: Option<String>Database name (optional)
host: Option<String>Host (optional, for connection routing)
port: Option<u16>Port (optional)
options: HashMap<String, String>Additional connection options
expires_at: Option<DateTime<Utc>>Credential expiration
source: CredentialSourceSource provider
Implementations§
Source§impl DatabaseCredential
impl DatabaseCredential
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if credential is expired
Sourcepub fn time_until_expiration(&self) -> Option<Duration>
pub fn time_until_expiration(&self) -> Option<Duration>
Get time until expiration
Sourcepub fn connection_string(&self) -> String
pub fn connection_string(&self) -> String
Build connection string
Trait Implementations§
Source§impl Clone for DatabaseCredential
impl Clone for DatabaseCredential
Source§fn clone(&self) -> DatabaseCredential
fn clone(&self) -> DatabaseCredential
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 moreAuto Trait Implementations§
impl Freeze for DatabaseCredential
impl RefUnwindSafe for DatabaseCredential
impl Send for DatabaseCredential
impl Sync for DatabaseCredential
impl Unpin for DatabaseCredential
impl UnsafeUnpin for DatabaseCredential
impl UnwindSafe for DatabaseCredential
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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