pub struct PostgresStorageConfig {
pub host: String,
pub port: u16,
pub database: String,
pub username: String,
pub password: String,
pub pool_size: u32,
pub connection_timeout: u64,
pub ssl_mode: SslMode,
}Expand description
PostgreSQL audit storage configuration
Fields§
§host: StringDatabase host
port: u16Database port
database: StringDatabase name
username: StringUsername
password: StringPassword
pool_size: u32Connection pool size
connection_timeout: u64Connection timeout in seconds
ssl_mode: SslModeEnable SSL
Implementations§
Source§impl PostgresStorageConfig
impl PostgresStorageConfig
Sourcepub fn new(
host: String,
port: u16,
database: String,
username: String,
password: String,
) -> Self
pub fn new( host: String, port: u16, database: String, username: String, password: String, ) -> Self
Create a new PostgreSQL storage configuration
Sourcepub fn with_pool_size(self, size: u32) -> Self
pub fn with_pool_size(self, size: u32) -> Self
Set pool size
Sourcepub fn with_timeout(self, timeout: u64) -> Self
pub fn with_timeout(self, timeout: u64) -> Self
Set connection timeout
Sourcepub fn with_ssl_mode(self, mode: SslMode) -> Self
pub fn with_ssl_mode(self, mode: SslMode) -> Self
Set SSL mode
Sourcepub fn connection_string(&self) -> String
pub fn connection_string(&self) -> String
Get connection string
Trait Implementations§
Source§impl Clone for PostgresStorageConfig
impl Clone for PostgresStorageConfig
Source§fn clone(&self) -> PostgresStorageConfig
fn clone(&self) -> PostgresStorageConfig
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 PostgresStorageConfig
impl RefUnwindSafe for PostgresStorageConfig
impl Send for PostgresStorageConfig
impl Sync for PostgresStorageConfig
impl Unpin for PostgresStorageConfig
impl UnsafeUnpin for PostgresStorageConfig
impl UnwindSafe for PostgresStorageConfig
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> 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