pub struct ConnectorPoolOptions { /* private fields */ }Expand description
Optional overrides for the sqlx connection pool and statement cache used by Nautilus executors.
Any field left unset preserves the backend-specific defaults used by
crate::PgExecutor::new, crate::MysqlExecutor::new, or
crate::SqliteExecutor::new.
Implementations§
Source§impl ConnectorPoolOptions
impl ConnectorPoolOptions
Sourcepub fn max_connections(self, max_connections: u32) -> Self
pub fn max_connections(self, max_connections: u32) -> Self
Override the maximum number of pooled connections.
Sourcepub fn min_connections(self, min_connections: u32) -> Self
pub fn min_connections(self, min_connections: u32) -> Self
Override the minimum number of pooled connections kept warm.
Sourcepub fn acquire_timeout(self, acquire_timeout: Duration) -> Self
pub fn acquire_timeout(self, acquire_timeout: Duration) -> Self
Override the maximum time spent waiting for a pooled connection.
Sourcepub fn idle_timeout(self, idle_timeout: impl Into<Option<Duration>>) -> Self
pub fn idle_timeout(self, idle_timeout: impl Into<Option<Duration>>) -> Self
Override the maximum idle duration for pooled connections.
Pass None to disable idle reaping entirely.
Sourcepub fn test_before_acquire(self, test_before_acquire: bool) -> Self
pub fn test_before_acquire(self, test_before_acquire: bool) -> Self
Override whether sqlx pings a connection before returning it from the pool.
Sourcepub fn statement_cache_capacity(self, statement_cache_capacity: usize) -> Self
pub fn statement_cache_capacity(self, statement_cache_capacity: usize) -> Self
Override the per-connection statement cache capacity used by sqlx.
Set this to 0 to disable statement caching entirely.
Sourcepub const fn get_max_connections(&self) -> Option<u32>
pub const fn get_max_connections(&self) -> Option<u32>
Return the configured maximum-connection override, if any.
Sourcepub const fn get_min_connections(&self) -> Option<u32>
pub const fn get_min_connections(&self) -> Option<u32>
Return the configured minimum-connection override, if any.
Sourcepub const fn get_acquire_timeout(&self) -> Option<Duration>
pub const fn get_acquire_timeout(&self) -> Option<Duration>
Return the configured acquire-timeout override, if any.
Sourcepub const fn get_idle_timeout(&self) -> Option<Option<Duration>>
pub const fn get_idle_timeout(&self) -> Option<Option<Duration>>
Return the configured idle-timeout override, if any.
None means “use the executor default”. Some(None) means “disable
idle timeout”. Some(Some(duration)) sets a custom timeout.
Sourcepub const fn get_test_before_acquire(&self) -> Option<bool>
pub const fn get_test_before_acquire(&self) -> Option<bool>
Return the configured test_before_acquire override, if any.
Sourcepub const fn get_statement_cache_capacity(&self) -> Option<usize>
pub const fn get_statement_cache_capacity(&self) -> Option<usize>
Return the configured statement-cache-capacity override, if any.
Trait Implementations§
Source§impl Clone for ConnectorPoolOptions
impl Clone for ConnectorPoolOptions
Source§fn clone(&self) -> ConnectorPoolOptions
fn clone(&self) -> ConnectorPoolOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ConnectorPoolOptions
Source§impl Debug for ConnectorPoolOptions
impl Debug for ConnectorPoolOptions
Source§impl Default for ConnectorPoolOptions
impl Default for ConnectorPoolOptions
Source§fn default() -> ConnectorPoolOptions
fn default() -> ConnectorPoolOptions
impl Eq for ConnectorPoolOptions
Source§impl PartialEq for ConnectorPoolOptions
impl PartialEq for ConnectorPoolOptions
Source§fn eq(&self, other: &ConnectorPoolOptions) -> bool
fn eq(&self, other: &ConnectorPoolOptions) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ConnectorPoolOptions
Auto Trait Implementations§
impl Freeze for ConnectorPoolOptions
impl RefUnwindSafe for ConnectorPoolOptions
impl Send for ConnectorPoolOptions
impl Sync for ConnectorPoolOptions
impl Unpin for ConnectorPoolOptions
impl UnsafeUnpin for ConnectorPoolOptions
impl UnwindSafe for ConnectorPoolOptions
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
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
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>
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>
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