mirror of
https://github.com/CloudNebulaProject/reddwarf.git
synced 2026-04-10 21:30:40 +00:00
24 lines
503 B
Rust
24 lines
503 B
Rust
|
|
use reddwarf_storage::RedbBackend;
|
||
|
|
use reddwarf_versioning::VersionStore;
|
||
|
|
use std::sync::Arc;
|
||
|
|
|
||
|
|
/// Shared application state
|
||
|
|
#[derive(Clone)]
|
||
|
|
pub struct AppState {
|
||
|
|
/// Storage backend
|
||
|
|
pub storage: Arc<RedbBackend>,
|
||
|
|
|
||
|
|
/// Version store
|
||
|
|
pub version_store: Arc<VersionStore>,
|
||
|
|
}
|
||
|
|
|
||
|
|
impl AppState {
|
||
|
|
/// Create a new AppState
|
||
|
|
pub fn new(storage: Arc<RedbBackend>, version_store: Arc<VersionStore>) -> Self {
|
||
|
|
Self {
|
||
|
|
storage,
|
||
|
|
version_store,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|