pub struct AppState {
pub store: Arc<EventStore>,
pub auth_manager: Arc<AuthManager>,
pub tenant_repo: Arc<dyn TenantRepository>,
pub service_container: ServiceContainer,
pub role: AtomicNodeRole,
pub wal_shipper: Arc<RwLock<Option<Arc<WalShipper>>>>,
pub wal_receiver: Option<Arc<WalReceiver>>,
pub replication_port: u16,
pub cluster_manager: Option<Arc<ClusterManager>>,
pub geo_replication: Option<Arc<GeoReplicationManager>>,
}Expand description
Unified application state for all handlers
Fields§
§store: Arc<EventStore>§auth_manager: Arc<AuthManager>§tenant_repo: Arc<dyn TenantRepository>§service_container: ServiceContainerService container for paywall domain use cases (Creator, Article, Payment, etc.)
role: AtomicNodeRoleNode role for leader-follower replication (runtime-mutable for failover)
wal_shipper: Arc<RwLock<Option<Arc<WalShipper>>>>WAL shipper for replication status reporting (leader only). Wrapped in RwLock so a promoted follower can install a shipper at runtime.
wal_receiver: Option<Arc<WalReceiver>>WAL receiver for replication status reporting (follower only)
replication_port: u16Replication port used by the WAL shipper (needed for runtime promotion)
cluster_manager: Option<Arc<ClusterManager>>Cluster manager for multi-node consensus and membership (optional)
geo_replication: Option<Arc<GeoReplicationManager>>Geo-replication manager for cross-region replication (optional)
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
Mutably borrows from an owned value. Read more