pub struct Container { /* private fields */ }Implementations§
Source§impl Container
impl Container
pub fn app(&self) -> &AppConfig
Sourcepub fn pool(&self) -> &Pool
pub fn pool(&self) -> &Pool
The default connection’s write pool. Returns &sqlx::PgPool for
backward compat — panics if the default connection isn’t Postgres.
For multi-driver code, use driver_pool() instead.
Sourcepub fn try_pool(&self) -> Option<&Pool>
pub fn try_pool(&self) -> Option<&Pool>
Same as pool() but returns Option<&PgPool> instead of panicking.
Sourcepub fn driver_pool(&self) -> Pool
pub fn driver_pool(&self) -> Pool
The default connection’s pool as the cast::Pool enum — Postgres / MySQL / SQLite.
Multi-driver code should use this and dispatch via match or .as_postgres().
Sourcepub fn connection(&self, name: &str) -> Option<Connection>
pub fn connection(&self, name: &str) -> Option<Connection>
Resolve a named connection. Returns None if not configured.
Sourcepub fn connections(&self) -> &ConnectionManager
pub fn connections(&self) -> &ConnectionManager
The connection manager itself, for advanced cases.
pub fn cache(&self) -> &CacheStore
pub fn mailer(&self) -> &MailerHandle
pub fn queue(&self) -> &QueueHandle
pub fn storage(&self) -> &StorageManager
pub fn events(&self) -> &EventBus
pub fn auth(&self) -> &AuthManager
Trait Implementations§
Source§impl FromContainer for Container
impl FromContainer for Container
fn from_container(container: &Container) -> Self
Auto Trait Implementations§
impl Freeze for Container
impl !RefUnwindSafe for Container
impl Send for Container
impl Sync for Container
impl Unpin for Container
impl UnsafeUnpin for Container
impl !UnwindSafe for Container
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> 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