pub struct PostgresConfig { /* private fields */ }Expand description
Runtime bounds for PostgreSQL admission work.
Implementations§
Source§impl PostgresConfig
impl PostgresConfig
Sourcepub const DEFAULT_MAX_BATCH_SIZE: usize = 32
pub const DEFAULT_MAX_BATCH_SIZE: usize = 32
Default maximum number of checks in one atomic batch.
Sourcepub const DEFAULT_OPERATION_TIMEOUT: Duration
pub const DEFAULT_OPERATION_TIMEOUT: Duration
Default total deadline for one check or cleanup operation.
Sourcepub const MAXIMUM_OPERATION_TIMEOUT: Duration
pub const MAXIMUM_OPERATION_TIMEOUT: Duration
Largest accepted online-operation deadline.
Sourcepub const fn new() -> Self
pub const fn new() -> Self
Returns the conservative defaults suitable for an online admission path.
Sourcepub fn with_max_batch_size(
self,
maximum: usize,
) -> Result<Self, PostgresConfigError>
pub fn with_max_batch_size( self, maximum: usize, ) -> Result<Self, PostgresConfigError>
Sets the maximum number of checks that may retain locks in one batch.
§Errors
Returns an error if maximum is zero.
Sourcepub fn with_operation_timeout(
self,
timeout: Duration,
) -> Result<Self, PostgresConfigError>
pub fn with_operation_timeout( self, timeout: Duration, ) -> Result<Self, PostgresConfigError>
Sets the total deadline for a check, batch, or cleanup statement.
The deadline covers pool acquisition, lock waits, statements, rollback, and commit. It is intentionally not applied to schema migrations.
§Errors
Returns an error if timeout is zero or exceeds 60 seconds.
Sourcepub const fn max_batch_size(&self) -> usize
pub const fn max_batch_size(&self) -> usize
Returns the maximum accepted batch length.
Sourcepub const fn operation_timeout(self) -> Duration
pub const fn operation_timeout(self) -> Duration
Returns the total deadline applied to an operation.
Trait Implementations§
Source§impl Clone for PostgresConfig
impl Clone for PostgresConfig
Source§fn clone(&self) -> PostgresConfig
fn clone(&self) -> PostgresConfig
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 moreimpl Copy for PostgresConfig
Source§impl Debug for PostgresConfig
impl Debug for PostgresConfig
Source§impl Default for PostgresConfig
impl Default for PostgresConfig
impl Eq for PostgresConfig
Source§impl PartialEq for PostgresConfig
impl PartialEq for PostgresConfig
impl StructuralPartialEq for PostgresConfig
Auto Trait Implementations§
impl Freeze for PostgresConfig
impl RefUnwindSafe for PostgresConfig
impl Send for PostgresConfig
impl Sync for PostgresConfig
impl Unpin for PostgresConfig
impl UnsafeUnpin for PostgresConfig
impl UnwindSafe for PostgresConfig
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<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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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