pub struct SessionPoolConfig { /* private fields */ }Expand description
Configuration for SessionPool.
Implementations§
Source§impl SessionPoolConfig
impl SessionPoolConfig
Sourcepub fn new(max_sessions: usize) -> Result<Self, SvnError>
pub fn new(max_sessions: usize) -> Result<Self, SvnError>
Creates a new config with max_sessions and no timeouts.
Sourcepub fn max_sessions(&self) -> usize
pub fn max_sessions(&self) -> usize
Returns the maximum number of concurrent sessions.
Sourcepub fn with_acquire_timeout(self, timeout: Duration) -> Self
pub fn with_acquire_timeout(self, timeout: Duration) -> Self
Sets a timeout for SessionPool::session when waiting for capacity.
Sourcepub fn with_idle_timeout(self, timeout: Duration) -> Self
pub fn with_idle_timeout(self, timeout: Duration) -> Self
Sets an idle timeout after which sessions are dropped.
Sourcepub fn with_health_check(self, health_check: SessionPoolHealthCheck) -> Self
pub fn with_health_check(self, health_check: SessionPoolHealthCheck) -> Self
Configures health checks for idle sessions.
Sourcepub fn with_prewarm_sessions(self, sessions: usize) -> Self
pub fn with_prewarm_sessions(self, sessions: usize) -> Self
Prewarms up to sessions idle connections when calling SessionPool::warm_up.
Values larger than max_sessions are clamped.
Trait Implementations§
Source§impl Clone for SessionPoolConfig
impl Clone for SessionPoolConfig
Source§fn clone(&self) -> SessionPoolConfig
fn clone(&self) -> SessionPoolConfig
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 SessionPoolConfig
impl RefUnwindSafe for SessionPoolConfig
impl Send for SessionPoolConfig
impl Sync for SessionPoolConfig
impl Unpin for SessionPoolConfig
impl UnwindSafe for SessionPoolConfig
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