pub struct StorageContext {
pub event_store: Arc<dyn EventStore>,
pub state_store: Arc<dyn StateStore>,
pub base_dir: PathBuf,
}Expand description
Storage context holding all configured stores
Use this to pass storage configuration throughout the application.
Fields§
§event_store: Arc<dyn EventStore>§state_store: Arc<dyn StateStore>§base_dir: PathBufImplementations§
Source§impl StorageContext
impl StorageContext
Sourcepub async fn new(
event_config: &EventStoreConfig,
state_config: &StateStoreConfig,
base_dir: PathBuf,
) -> Result<Self>
pub async fn new( event_config: &EventStoreConfig, state_config: &StateStoreConfig, base_dir: PathBuf, ) -> Result<Self>
Create a new storage context from configuration
Trait Implementations§
Source§impl Clone for StorageContext
impl Clone for StorageContext
Source§fn clone(&self) -> StorageContext
fn clone(&self) -> StorageContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for StorageContext
impl !RefUnwindSafe for StorageContext
impl Send for StorageContext
impl Sync for StorageContext
impl Unpin for StorageContext
impl UnsafeUnpin for StorageContext
impl !UnwindSafe for StorageContext
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