pub struct AppContext { /* private fields */ }Implementations§
Source§impl AppContext
impl AppContext
Sourcepub fn downgrade(&self) -> AppContextWeak
pub fn downgrade(&self) -> AppContextWeak
Get an AppContextWeak from Self.
Sourcepub fn config(&self) -> &AppConfig
pub fn config(&self) -> &AppConfig
Get the app’s AppContext.
Sourcepub fn metadata(&self) -> &AppMetadata
pub fn metadata(&self) -> &AppMetadata
Get the app’s AppMetadata
Sourcepub fn health_checks(&self) -> Vec<Arc<dyn HealthCheck>>
pub fn health_checks(&self) -> Vec<Arc<dyn HealthCheck>>
Returns the HealthChecks that were registered in the HealthCheckRegistry, or
an empty Vec if no HealthChecks were registered.
Sourcepub fn sea_orm(&self) -> &DatabaseConnection
pub fn sea_orm(&self) -> &DatabaseConnection
Get the sea-orm DB connection pool.
pub fn diesel_pg_pool(&self) -> &DieselPgPool
pub fn diesel_mysql_pool(&self) -> &DieselMysqlPool
pub fn diesel_sqlite_pool(&self) -> &DieselSqlitePool
pub fn diesel_pg_pool_async(&self) -> &DieselPgPoolAsync
pub fn diesel_mysql_pool_async(&self) -> &DieselMysqlPoolAsync
Sourcepub fn redis_enqueue(&self) -> &RedisEnqueue
pub fn redis_enqueue(&self) -> &RedisEnqueue
Get the Redis connection pool used to enqueue Sidekiq jobs.
Sourcepub fn redis_fetch(&self) -> &Option<RedisFetch>
pub fn redis_fetch(&self) -> &Option<RedisFetch>
Get the Redis connection pool used to fetch Sidekiq jobs. This shouldn’t be needed by most applications but is provided as a convenience in case it is.
Sourcepub fn smtp(&self) -> &SmtpTransport
pub fn smtp(&self) -> &SmtpTransport
Get the SMTP client. Used to send emails via the SMTP protocol
Trait Implementations§
Source§impl Clone for AppContext
impl Clone for AppContext
Source§fn clone(&self) -> AppContext
fn clone(&self) -> AppContext
Returns a copy 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 Provide<AppMetadata> for AppContext
impl Provide<AppMetadata> for AppContext
fn provide(&self) -> AppMetadata
Source§impl Provide<Option<RedisFetch>> for AppContext
impl Provide<Option<RedisFetch>> for AppContext
fn provide(&self) -> Option<RedisFetch>
Source§impl Provide<Pool<ConnectionManager<MysqlConnection>>> for AppContext
impl Provide<Pool<ConnectionManager<MysqlConnection>>> for AppContext
fn provide(&self) -> DieselMysqlPool
Source§impl Provide<Pool<ConnectionManager<PgConnection>>> for AppContext
impl Provide<Pool<ConnectionManager<PgConnection>>> for AppContext
fn provide(&self) -> DieselPgPool
Source§impl Provide<Pool<ConnectionManager<SqliteConnection>>> for AppContext
impl Provide<Pool<ConnectionManager<SqliteConnection>>> for AppContext
fn provide(&self) -> DieselSqlitePool
Source§impl Provide<RedisEnqueue> for AppContext
impl Provide<RedisEnqueue> for AppContext
fn provide(&self) -> RedisEnqueue
Source§impl Provide<SmtpTransport> for AppContext
impl Provide<SmtpTransport> for AppContext
fn provide(&self) -> SmtpTransport
Source§impl Provide<Vec<Arc<dyn HealthCheck>>> for AppContext
impl Provide<Vec<Arc<dyn HealthCheck>>> for AppContext
Source§impl ProvideRef<AppConfig> for AppContext
impl ProvideRef<AppConfig> for AppContext
Source§impl ProvideRef<AppMetadata> for AppContext
impl ProvideRef<AppMetadata> for AppContext
fn provide(&self) -> &AppMetadata
Source§impl ProvideRef<DatabaseConnection> for AppContext
impl ProvideRef<DatabaseConnection> for AppContext
fn provide(&self) -> &DatabaseConnection
Source§impl ProvideRef<Pool<AsyncDieselConnectionManager<AsyncMysqlConnection>>> for AppContext
impl ProvideRef<Pool<AsyncDieselConnectionManager<AsyncMysqlConnection>>> for AppContext
fn provide(&self) -> &DieselMysqlPoolAsync
Source§impl ProvideRef<Pool<AsyncDieselConnectionManager<AsyncPgConnection>>> for AppContext
impl ProvideRef<Pool<AsyncDieselConnectionManager<AsyncPgConnection>>> for AppContext
fn provide(&self) -> &DieselPgPoolAsync
Source§impl ProvideRef<Pool<ConnectionManager<MysqlConnection>>> for AppContext
impl ProvideRef<Pool<ConnectionManager<MysqlConnection>>> for AppContext
fn provide(&self) -> &DieselMysqlPool
Source§impl ProvideRef<Pool<ConnectionManager<PgConnection>>> for AppContext
impl ProvideRef<Pool<ConnectionManager<PgConnection>>> for AppContext
fn provide(&self) -> &DieselPgPool
Source§impl ProvideRef<Pool<ConnectionManager<SqliteConnection>>> for AppContext
impl ProvideRef<Pool<ConnectionManager<SqliteConnection>>> for AppContext
fn provide(&self) -> &DieselSqlitePool
Source§impl ProvideRef<RedisEnqueue> for AppContext
impl ProvideRef<RedisEnqueue> for AppContext
fn provide(&self) -> &RedisEnqueue
Source§impl ProvideRef<Sender> for AppContext
impl ProvideRef<Sender> for AppContext
Source§impl ProvideRef<SmtpTransport> for AppContext
impl ProvideRef<SmtpTransport> for AppContext
fn provide(&self) -> &SmtpTransport
Auto Trait Implementations§
impl Freeze for AppContext
impl !RefUnwindSafe for AppContext
impl Send for AppContext
impl Sync for AppContext
impl Unpin for AppContext
impl !UnwindSafe for AppContext
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
type Err = Infallible
fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
Source§impl<T> IntoSql for T
impl<T> IntoSql for T
Source§fn into_sql<T>(self) -> Self::Expression
fn into_sql<T>(self) -> Self::Expression
Convert
self to an expression for Diesel’s query builder. Read moreSource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expression
Convert
&self to an expression for Diesel’s query builder. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T, Conn> RunQueryDsl<Conn> for T
impl<T, Conn> RunQueryDsl<Conn> for T
Source§fn execute<'conn, 'query>(
self,
conn: &'conn mut Conn,
) -> <Conn as AsyncConnection>::ExecuteFuture<'conn, 'query>
fn execute<'conn, 'query>( self, conn: &'conn mut Conn, ) -> <Conn as AsyncConnection>::ExecuteFuture<'conn, 'query>
Executes the given command, returning the number of rows affected. Read more
Source§fn load<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(_: Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>
fn load<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(_: Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>
Source§fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnection,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
fn load_stream<'conn, 'query, U>(
self,
conn: &'conn mut Conn,
) -> Self::LoadFuture<'conn>where
Conn: AsyncConnection,
U: 'conn,
Self: LoadQuery<'query, Conn, U> + 'query,
Source§fn get_result<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>, fn(_: Self::Stream<'conn>) -> Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>>
fn get_result<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>, fn(_: Self::Stream<'conn>) -> Map<StreamFuture<Pin<Box<Self::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<Self::Stream<'conn>>>)) -> Result<U, Error>>>
Runs the command, and returns the affected row. Read more
Source§fn get_results<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(_: Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>
fn get_results<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<Self::LoadFuture<'conn>, TryCollect<Self::Stream<'conn>, Vec<U>>, fn(_: Self::Stream<'conn>) -> TryCollect<Self::Stream<'conn>, Vec<U>>>
Runs the command, returning an
Vec with the affected rows. Read moreSource§fn first<'query, 'conn, U>(
self,
conn: &'conn mut Conn,
) -> AndThen<<Self::Output as LoadQuery<'query, Conn, U>>::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>, fn(_: <Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>) -> Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>>
fn first<'query, 'conn, U>( self, conn: &'conn mut Conn, ) -> AndThen<<Self::Output as LoadQuery<'query, Conn, U>>::LoadFuture<'conn>, Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>, fn(_: <Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>) -> Map<StreamFuture<Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>>, fn(_: (Option<Result<U, Error>>, Pin<Box<<Self::Output as LoadQuery<'query, Conn, U>>::Stream<'conn>>>)) -> Result<U, Error>>>
Attempts to load a single record. Read more