pub struct AppState {
pub pool: Pool,
pub model: Arc<RwLock<ResolvedModel>>,
pub package_models: Arc<RwLock<HashMap<String, ResolvedModel>>>,
pub tenant_pools: Arc<RwLock<HashMap<String, Pool>>>,
pub tenant_registry: Arc<TenantRegistry>,
pub storage: Option<Arc<dyn StorageProvider>>,
pub event_client: Option<Arc<DecisionHubClient>>,
pub authrs_client: Option<Arc<AuthrsClient>>,
pub dialect: Arc<dyn Dialect>,
pub extensible_cache: RegistryCache,
}Fields§
§pool: PoolDefault/central pool (from DATABASE_URL).
model: Arc<RwLock<ResolvedModel>>Default/active model (used for /api/v1/:path_segment). Reloaded after package install.
package_models: Arc<RwLock<HashMap<String, ResolvedModel>>>Resolved model per package_id. For database tenants, key is “package_id:tenant_id”.
tenant_pools: Arc<RwLock<HashMap<String, Pool>>>Pools for database-strategy tenants, keyed by tenant_id.
tenant_registry: Arc<TenantRegistry>Tenant registry (strategy + config per tenant), loaded from central DB at startup.
storage: Option<Arc<dyn StorageProvider>>Optional blob storage provider for asset columns.
event_client: Option<Arc<DecisionHubClient>>Optional decision-hub client. None when DECISION_HUB_URL is not set.
authrs_client: Option<Arc<AuthrsClient>>Optional authrs permission-check client. None when AUTHRS_URL or SERVICE_NAME is not set.
dialect: Arc<dyn Dialect>Active database dialect (set at startup via db::active_dialect()).
extensible_cache: RegistryCachePer-tenant extensible-field registry cache (read-through, TTL-bounded, evicted on write).
Construct with Default::default().
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
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>
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