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.
pub fn pgmq(&self) -> &PGMQueue
Sourcepub fn smtp(&self) -> &SmtpTransport
pub fn smtp(&self) -> &SmtpTransport
Get the SMTP client. Used to send emails via the SMTP protocol
Sourcepub fn sendgrid(&self) -> &Sender
pub fn sendgrid(&self) -> &Sender
Get the Sendgrid client. Used to send emails via Sendgrid’s Mail Send API.
pub fn get_extension<T>(&self) -> RoadsterResult<&T>
Trait Implementations§
Source§impl Clone for AppContext
impl Clone for AppContext
Source§impl Provide<AppMetadata> for AppContext
impl Provide<AppMetadata> for AppContext
fn provide(&self) -> AppMetadata
Source§impl Provide<Option<RedisFetch>> for AppContext
Available on crate feature worker-sidekiq only.
impl Provide<Option<RedisFetch>> for AppContext
Available on crate feature
worker-sidekiq only.fn provide(&self) -> Option<RedisFetch>
Source§impl Provide<PGMQueue> for AppContext
Available on crate feature worker-pg only.
impl Provide<PGMQueue> for AppContext
Available on crate feature
worker-pg only.Source§impl Provide<Pool<ConnectionManager<MysqlConnection>>> for AppContext
Available on crate feature db-diesel-mysql-pool only.
impl Provide<Pool<ConnectionManager<MysqlConnection>>> for AppContext
Available on crate feature
db-diesel-mysql-pool only.fn provide(&self) -> DieselMysqlPool
Source§impl Provide<Pool<ConnectionManager<PgConnection>>> for AppContext
Available on crate feature db-diesel-postgres-pool only.
impl Provide<Pool<ConnectionManager<PgConnection>>> for AppContext
Available on crate feature
db-diesel-postgres-pool only.fn provide(&self) -> DieselPgPool
Source§impl Provide<Pool<ConnectionManager<SqliteConnection>>> for AppContext
Available on crate feature db-diesel-sqlite-pool only.
impl Provide<Pool<ConnectionManager<SqliteConnection>>> for AppContext
Available on crate feature
db-diesel-sqlite-pool only.fn provide(&self) -> DieselSqlitePool
Source§impl Provide<RedisEnqueue> for AppContext
Available on crate feature worker-sidekiq only.
impl Provide<RedisEnqueue> for AppContext
Available on crate feature
worker-sidekiq only.fn provide(&self) -> RedisEnqueue
Source§impl Provide<Sender> for AppContext
Available on crate feature email-sendgrid only.
impl Provide<Sender> for AppContext
Available on crate feature
email-sendgrid only.Source§impl Provide<SmtpTransport> for AppContext
Available on crate feature email-smtp only.
impl Provide<SmtpTransport> for AppContext
Available on crate feature
email-smtp only.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
Available on crate feature db-sea-orm only.
impl ProvideRef<DatabaseConnection> for AppContext
Available on crate feature
db-sea-orm only.fn provide(&self) -> &DatabaseConnection
Source§impl ProvideRef<PGMQueue> for AppContext
Available on crate feature worker-pg only.
impl ProvideRef<PGMQueue> for AppContext
Available on crate feature
worker-pg only.Source§impl ProvideRef<Pool<AsyncDieselConnectionManager<AsyncMysqlConnection>>> for AppContext
Available on crate feature db-diesel-mysql-pool-async only.
impl ProvideRef<Pool<AsyncDieselConnectionManager<AsyncMysqlConnection>>> for AppContext
Available on crate feature
db-diesel-mysql-pool-async only.fn provide(&self) -> &DieselMysqlPoolAsync
Source§impl ProvideRef<Pool<AsyncDieselConnectionManager<AsyncPgConnection>>> for AppContext
Available on crate feature db-diesel-postgres-pool-async only.
impl ProvideRef<Pool<AsyncDieselConnectionManager<AsyncPgConnection>>> for AppContext
Available on crate feature
db-diesel-postgres-pool-async only.fn provide(&self) -> &DieselPgPoolAsync
Source§impl ProvideRef<Pool<ConnectionManager<MysqlConnection>>> for AppContext
Available on crate feature db-diesel-mysql-pool only.
impl ProvideRef<Pool<ConnectionManager<MysqlConnection>>> for AppContext
Available on crate feature
db-diesel-mysql-pool only.fn provide(&self) -> &DieselMysqlPool
Source§impl ProvideRef<Pool<ConnectionManager<PgConnection>>> for AppContext
Available on crate feature db-diesel-postgres-pool only.
impl ProvideRef<Pool<ConnectionManager<PgConnection>>> for AppContext
Available on crate feature
db-diesel-postgres-pool only.fn provide(&self) -> &DieselPgPool
Source§impl ProvideRef<Pool<ConnectionManager<SqliteConnection>>> for AppContext
Available on crate feature db-diesel-sqlite-pool only.
impl ProvideRef<Pool<ConnectionManager<SqliteConnection>>> for AppContext
Available on crate feature
db-diesel-sqlite-pool only.fn provide(&self) -> &DieselSqlitePool
Source§impl ProvideRef<RedisEnqueue> for AppContext
Available on crate feature worker-sidekiq only.
impl ProvideRef<RedisEnqueue> for AppContext
Available on crate feature
worker-sidekiq only.fn provide(&self) -> &RedisEnqueue
Source§impl ProvideRef<Sender> for AppContext
Available on crate feature email-sendgrid only.
impl ProvideRef<Sender> for AppContext
Available on crate feature
email-sendgrid only.Source§impl ProvideRef<SmtpTransport> for AppContext
Available on crate feature email-smtp only.
impl ProvideRef<SmtpTransport> for AppContext
Available on crate feature
email-smtp only.fn provide(&self) -> &SmtpTransport
Auto Trait Implementations§
impl !RefUnwindSafe for AppContext
impl !UnwindSafe for AppContext
impl Freeze for AppContext
impl Send for AppContext
impl Sync for AppContext
impl Unpin for AppContext
impl UnsafeUnpin 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 = !
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> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
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
Source§impl<T> ServiceExt for T
impl<T> ServiceExt for T
Source§fn compression(self) -> Compression<Self>where
Self: Sized,
fn compression(self) -> Compression<Self>where
Self: Sized,
Compresses response bodies. Read more
Source§fn decompression(self) -> Decompression<Self>where
Self: Sized,
fn decompression(self) -> Decompression<Self>where
Self: Sized,
Decompress response bodies. Read more
Source§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
Source§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more
Source§fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
fn follow_redirects(self) -> FollowRedirect<Self>where
Self: Sized,
Source§fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
fn sensitive_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<SetSensitiveResponseHeaders<Self>>where
Self: Sized,
Source§fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
fn sensitive_request_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveRequestHeaders<Self>where
Self: Sized,
Source§fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
fn sensitive_response_headers(
self,
headers: impl IntoIterator<Item = HeaderName>,
) -> SetSensitiveResponseHeaders<Self>where
Self: Sized,
Source§fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn override_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Insert a header into the request. Read more
Source§fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn append_request_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Append a header into the request. Read more
Source§fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
fn insert_request_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetRequestHeader<Self, M>where
Self: Sized,
Insert a header into the request, if the header is not already present. Read more
Source§fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn override_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Insert a header into the response. Read more
Source§fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn append_response_header<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Append a header into the response. Read more
Source§fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
fn insert_response_header_if_not_present<M>(
self,
header_name: HeaderName,
make: M,
) -> SetResponseHeader<Self, M>where
Self: Sized,
Insert a header into the response, if the header is not already present. Read more
Source§fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_request_id<M>(
self,
header_name: HeaderName,
make_request_id: M,
) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Add request id header and extension. Read more
Source§fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
fn set_x_request_id<M>(self, make_request_id: M) -> SetRequestId<Self, M>where
Self: Sized,
M: MakeRequestId,
Add request id header and extension, using
x-request-id as the header name. Read moreSource§fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_request_id(
self,
header_name: HeaderName,
) -> PropagateRequestId<Self>where
Self: Sized,
Propgate request ids from requests to responses. Read more
Source§fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
fn propagate_x_request_id(self) -> PropagateRequestId<Self>where
Self: Sized,
Propgate request ids from requests to responses, using
x-request-id as the header name. Read moreSource§fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
fn catch_panic(self) -> CatchPanic<Self, DefaultResponseForPanic>where
Self: Sized,
Catch panics and convert them into
500 Internal Server responses. Read moreSource§fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
fn request_body_limit(self, limit: usize) -> RequestBodyLimit<Self>where
Self: Sized,
Intercept requests with over-sized payloads and convert them into
413 Payload Too Large responses. Read moreSource§fn trim_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
fn trim_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
Remove trailing slashes from paths. Read more
Source§fn append_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
fn append_trailing_slash(self) -> NormalizePath<Self>where
Self: Sized,
Append trailing slash to paths. Read more