pub struct AppState {
pub pool: PgPool,
pub config: Arc<Config>,
pub mailer: Mailer,
pub http: Client,
pub channel_key: ChannelKey,
pub notify_http: GuardedHttp,
pub shutdown: CancellationToken,
pub anon_calls: Arc<CallLimiter>,
}Fields§
§pool: PgPool§config: Arc<Config>§mailer: Mailer§http: ClientFor outgoing calls (GitHub OAuth).
channel_key: ChannelKeyEncrypts and decrypts alert channel targets (derived from SECRET_KEY).
notify_http: GuardedHttpFor “Send test” and for checking a webhook address when it is saved: the same guarded client the job runner delivers with (the cloud refuses private and internal addresses, self-hosted allows them).
shutdown: CancellationTokenCancelled when the server begins shutting down (crate::serve), so long-lived
connections that axum’s graceful shutdown would wait for (/mcp calls) end.
anon_calls: Arc<CallLimiter>Calls per minute of the no-key MCP tools, per client address.
Implementations§
Trait Implementations§
Source§impl FromRequestParts<AppState> for ClientIp
impl FromRequestParts<AppState> for ClientIp
Source§impl FromRequestParts<AppState> for ApiCaller
A handler argument that requires an API key. Rejects with the JSON 401.
impl FromRequestParts<AppState> for ApiCaller
A handler argument that requires an API key. Rejects with the JSON 401.
Source§type Rejection = AgentError
type Rejection = AgentError
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§async fn from_request_parts(
parts: &mut Parts,
state: &AppState,
) -> Result<ApiCaller, AgentError>
async fn from_request_parts( parts: &mut Parts, state: &AppState, ) -> Result<ApiCaller, AgentError>
Perform the extraction.
Source§impl FromRequestParts<AppState> for CurrentUser
impl FromRequestParts<AppState> for CurrentUser
Source§type Rejection = AuthRejection
type Rejection = AuthRejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§async fn from_request_parts(
parts: &mut Parts,
state: &AppState,
) -> Result<CurrentUser, AuthRejection>
async fn from_request_parts( parts: &mut Parts, state: &AppState, ) -> Result<CurrentUser, AuthRejection>
Perform the extraction.
Source§impl FromRequestParts<AppState> for CloudUser
impl FromRequestParts<AppState> for CloudUser
Source§type Rejection = AuthRejection
type Rejection = AuthRejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§async fn from_request_parts(
parts: &mut Parts,
state: &AppState,
) -> Result<CloudUser, AuthRejection>
async fn from_request_parts( parts: &mut Parts, state: &AppState, ) -> Result<CloudUser, AuthRejection>
Perform the extraction.
Source§impl OptionalFromRequestParts<AppState> for CurrentUser
Option<CurrentUser>: None when signed out, for pages that work either way.
impl OptionalFromRequestParts<AppState> for CurrentUser
Option<CurrentUser>: None when signed out, for pages that work either way.
Auto Trait Implementations§
impl !RefUnwindSafe for AppState
impl !UnwindSafe for AppState
impl Freeze for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
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> 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