pub struct AppState {
pub storage: Arc<dyn Storage>,
pub declared_kbs: Arc<BTreeMap<String, KbSlug>>,
pub access_policies: Arc<BTreeMap<String, Arc<AccessPolicy>>>,
pub bearer_token: Arc<String>,
pub max_body_size: u64,
pub max_patchable_size: u64,
pub indexer_tx: Sender<IndexEvent>,
pub searcher: Arc<dyn Searcher>,
}Expand description
Application state shared across all axum handlers.
This is cloned cheaply for each request (all fields are behind Arc).
Fields§
§storage: Arc<dyn Storage>The backing storage implementation (injected at startup).
declared_kbs: Arc<BTreeMap<String, KbSlug>>Canonical map of slug string → KbSlug for declared knowledge bases.
access_policies: Arc<BTreeMap<String, Arc<AccessPolicy>>>Startup snapshot of manifest access policies, keyed by KB slug.
One Arc per policy so a request-scoped authorization handle can hold
its knowledge base’s policy cheaply instead of borrowing the whole map.
bearer_token: Arc<String>Static Bearer token for authenticating API requests.
max_body_size: u64Maximum accepted PUT body size in bytes (16 MiB in M2).
max_patchable_size: u64Maximum object size eligible for patch operations, in bytes.
indexer_tx: Sender<IndexEvent>Sender half of the async indexing queue.
searcher: Arc<dyn Searcher>The search implementation (injected at startup).
Trait Implementations§
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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::Request