pub struct MaxConnections(/* private fields */);Expand description
Maximum number of database connections in the pool.
MaxConnections represents the connection pool size limit. It must be at least 1, enforced by using NonZeroU32 as the underlying type.
§Examples
ⓘ
use eventcore_postgres::MaxConnections;
use std::num::NonZeroU32;
let small_pool = MaxConnections::new(NonZeroU32::new(5).expect("5 is non-zero"));
let standard = MaxConnections::new(NonZeroU32::new(10).expect("10 is non-zero"));
let large_pool = MaxConnections::new(NonZeroU32::new(50).expect("50 is non-zero"));
// Zero connections not allowed by type system
// let zero = NonZeroU32::new(0); // Returns NoneImplementations§
Source§impl MaxConnections
impl MaxConnections
pub fn new(raw_value: NonZeroU32) -> Self
Source§impl MaxConnections
impl MaxConnections
pub fn into_inner(self) -> NonZeroU32
Trait Implementations§
Source§impl AsRef<NonZero<u32>> for MaxConnections
impl AsRef<NonZero<u32>> for MaxConnections
Source§fn as_ref(&self) -> &NonZeroU32
fn as_ref(&self) -> &NonZeroU32
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl Clone for MaxConnections
impl Clone for MaxConnections
Source§fn clone(&self) -> MaxConnections
fn clone(&self) -> MaxConnections
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 MaxConnections
impl Debug for MaxConnections
Source§impl Display for MaxConnections
impl Display for MaxConnections
Source§impl From<MaxConnections> for NonZeroU32
impl From<MaxConnections> for NonZeroU32
Source§fn from(value: MaxConnections) -> Self
fn from(value: MaxConnections) -> Self
Converts to this type from the input type.
Source§impl PartialEq for MaxConnections
impl PartialEq for MaxConnections
impl Copy for MaxConnections
impl Eq for MaxConnections
impl StructuralPartialEq for MaxConnections
Auto Trait Implementations§
impl Freeze for MaxConnections
impl RefUnwindSafe for MaxConnections
impl Send for MaxConnections
impl Sync for MaxConnections
impl Unpin for MaxConnections
impl UnwindSafe for MaxConnections
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<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