[−][src]Struct krill::commons::eventsourcing::DiskKeyStore
This type can store and retrieve values to/from disk, using json serialization.
Methods
impl DiskKeyStore
[src]
pub fn new(work_dir: &PathBuf, name_space: &str) -> Self
[src]
pub fn under_work_dir(
work_dir: &PathBuf,
name_space: &str
) -> Result<Self, Error>
[src]
work_dir: &PathBuf,
name_space: &str
) -> Result<Self, Error>
Creates a directory for the name_space under the work_dir.
pub fn update_aggregate<A: Aggregate>(
&self,
id: &Handle,
aggregate: &mut A
) -> Result<(), KeyStoreError>
[src]
&self,
id: &Handle,
aggregate: &mut A
) -> Result<(), KeyStoreError>
pub fn history<A: Aggregate>(
&self,
id: &Handle
) -> Result<AggregateHistory<A>, KeyStoreError>
[src]
&self,
id: &Handle
) -> Result<AggregateHistory<A>, KeyStoreError>
Trait Implementations
impl KeyStore for DiskKeyStore
[src]
type Key = PathBuf
fn key_for_snapshot() -> Self::Key
[src]
fn key_for_event(version: u64) -> Self::Key
[src]
fn key_for_command(time: Time) -> Self::Key
[src]
fn has_key(&self, id: &Handle, key: &Self::Key) -> bool
[src]
fn has_aggregate(&self, id: &Handle) -> bool
[src]
fn aggregates(&self) -> Vec<Handle>
[src]
fn store<V: Any + Serialize>(
&self,
id: &Handle,
key: &Self::Key,
value: &V
) -> Result<(), KeyStoreError>
[src]
&self,
id: &Handle,
key: &Self::Key,
value: &V
) -> Result<(), KeyStoreError>
fn get<V: Any + Storable>(
&self,
id: &Handle,
key: &Self::Key
) -> Result<Option<V>, KeyStoreError>
[src]
&self,
id: &Handle,
key: &Self::Key
) -> Result<Option<V>, KeyStoreError>
fn get_event<V: Event>(
&self,
id: &Handle,
version: u64
) -> Result<Option<V>, KeyStoreError>
[src]
&self,
id: &Handle,
version: u64
) -> Result<Option<V>, KeyStoreError>
Get the value for this key, if any exists.
fn store_event<V: Event>(&self, event: &V) -> Result<(), KeyStoreError>
[src]
fn store_command(&self, command: StoredCommand) -> Result<(), KeyStoreError>
[src]
fn get_aggregate<V: Aggregate>(
&self,
id: &Handle
) -> Result<Option<V>, KeyStoreError>
[src]
&self,
id: &Handle
) -> Result<Option<V>, KeyStoreError>
fn store_aggregate<V: Aggregate>(
&self,
id: &Handle,
aggregate: &V
) -> Result<(), KeyStoreError>
[src]
&self,
id: &Handle,
aggregate: &V
) -> Result<(), KeyStoreError>
Auto Trait Implementations
impl Send for DiskKeyStore
impl Sync for DiskKeyStore
impl Unpin for DiskKeyStore
impl UnwindSafe for DiskKeyStore
impl RefUnwindSafe for DiskKeyStore
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
fn vzip(self) -> V
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,