pub struct AppState {Show 22 fields
pub config: Arc<ServerConfig>,
pub query_engine: Arc<QueryEngine>,
pub document_engine: Arc<DocumentEngine>,
pub timeseries_engine: Arc<TimeSeriesEngine>,
pub streaming_engine: Arc<StreamingEngine>,
pub kv_store: Arc<KvStore>,
pub metrics: Arc<RwLock<Metrics>>,
pub admin: Arc<AdminService>,
pub auth: Arc<AuthService>,
pub activity: Arc<ActivityLogger>,
pub settings: Arc<RwLock<ServerSettings>>,
pub metrics_history: Arc<RwLock<VecDeque<MetricsDataPoint>>>,
pub graph_store: Arc<GraphStore>,
pub rbac: Arc<RbacManager>,
pub rate_limiter: Arc<RateLimiter>,
pub login_rate_limiter: Arc<RateLimiter>,
pub gdpr: Arc<GdprService>,
pub consent_manager: Arc<ConsentManager>,
pub breach_detector: Arc<BreachDetector>,
pub update_orchestrator: Arc<UpdateOrchestrator>,
pub vault: Arc<AegisVault>,
pub shield: Arc<ShieldEngine>,
/* private fields */
}Expand description
Shared application state with real engine integrations.
Fields§
§config: Arc<ServerConfig>§query_engine: Arc<QueryEngine>§document_engine: Arc<DocumentEngine>§timeseries_engine: Arc<TimeSeriesEngine>§streaming_engine: Arc<StreamingEngine>§kv_store: Arc<KvStore>§metrics: Arc<RwLock<Metrics>>§admin: Arc<AdminService>§auth: Arc<AuthService>§activity: Arc<ActivityLogger>§settings: Arc<RwLock<ServerSettings>>§metrics_history: Arc<RwLock<VecDeque<MetricsDataPoint>>>§graph_store: Arc<GraphStore>§rbac: Arc<RbacManager>§rate_limiter: Arc<RateLimiter>§login_rate_limiter: Arc<RateLimiter>§gdpr: Arc<GdprService>§consent_manager: Arc<ConsentManager>§breach_detector: Arc<BreachDetector>§update_orchestrator: Arc<UpdateOrchestrator>§vault: Arc<AegisVault>§shield: Arc<ShieldEngine>Implementations§
Source§impl AppState
impl AppState
Sourcepub fn new(config: ServerConfig) -> Self
pub fn new(config: ServerConfig) -> Self
Create new application state with the given configuration.
Admin credentials are resolved from environment variables only.
For vault-backed credentials, use with_secrets instead.
Sourcepub fn with_secrets(
config: ServerConfig,
secrets: Option<&dyn SecretsProvider>,
) -> Self
pub fn with_secrets( config: ServerConfig, secrets: Option<&dyn SecretsProvider>, ) -> Self
Create new application state with secrets provider for admin credentials.
Sourcepub async fn save_settings(&self)
pub async fn save_settings(&self)
Save server settings to disk (if data_dir is configured).
Sourcepub fn flush_collection(&self, collection_name: &str)
pub fn flush_collection(&self, collection_name: &str)
Flush a single document collection to disk (if data_dir is configured).
Sourcepub fn save_to_disk(&self) -> Result<()>
pub fn save_to_disk(&self) -> Result<()>
Save all data to disk (if data_dir is configured).
Sourcepub async fn execute_query(
&self,
sql: &str,
database: Option<&str>,
) -> Result<QueryResult, QueryError>
pub async fn execute_query( &self, sql: &str, database: Option<&str>, ) -> Result<QueryResult, QueryError>
Execute a SQL query against the specified database.
Sourcepub async fn execute_query_replicated(
&self,
sql: &str,
database: Option<&str>,
) -> Result<QueryResult, QueryError>
pub async fn execute_query_replicated( &self, sql: &str, database: Option<&str>, ) -> Result<QueryResult, QueryError>
Execute a query that was received via replication (skip re-replication).
Sourcepub async fn execute_query_with_params(
&self,
sql: &str,
database: Option<&str>,
params: &[Value],
) -> Result<QueryResult, QueryError>
pub async fn execute_query_with_params( &self, sql: &str, database: Option<&str>, params: &[Value], ) -> Result<QueryResult, QueryError>
Execute a SQL query with bound parameters.
Sourcepub async fn record_request(&self, duration_ms: u64, success: bool)
pub async fn record_request(&self, duration_ms: u64, success: bool)
Record a request metric.
Sourcepub async fn init_metrics_history(&self)
pub async fn init_metrics_history(&self)
Initialize metrics history - starts empty, will be populated by real metrics collection.
Sourcepub fn get_database_stats(&self) -> DatabaseStats
pub fn get_database_stats(&self) -> DatabaseStats
Get comprehensive database statistics.
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
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>
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