pub struct AppState { /* private fields */ }Expand description
Shared, immutable server state.
The resolved configuration plus the tenancy store: the metering log
is owned by the auth layer, which is applied around the router
rather than inside it, and the key store is shared with that layer.
A handler still cannot reach a secret — [KeyStore] exposes none;
the state holds it for exactly one number, the active-key count the
ownerless-index rule turns on (see crate::tenancy). Tenancy is
different — a handler must consult it before touching an index —
and it carries no secrets, only ownership records. The Envelope
is the abuse-envelope state of paid-path S3: the query routes’
concurrency cap and per-key index-operation permits
(see crate::limits).
Implementations§
Source§impl AppState
impl AppState
Sourcepub fn new(
config: Arc<Config>,
keys: Arc<KeyStore>,
tenancy: Arc<Tenancy>,
) -> Self
pub fn new( config: Arc<Config>, keys: Arc<KeyStore>, tenancy: Arc<Tenancy>, ) -> Self
Wraps a resolved Config and the Tenancy store as axum state.
Takes the Arcs the process already holds rather than values, so
the state and the configuration main logs at startup are provably
the same values and building a router in a test does not require
cloning either. The envelope is process state, not configuration,
so it is created here rather than passed in.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppState
impl RefUnwindSafe for AppState
impl Send for AppState
impl Sync for AppState
impl Unpin for AppState
impl UnsafeUnpin for AppState
impl UnwindSafe 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
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,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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