[−][src]Struct krill::commons::eventsourcing::DiskKeyStore
This type can store and retrieve values to/from disk, using json serialization.
Implementations
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>
Trait Implementations
impl KeyStore for DiskKeyStore
[src]
type Key = PathBuf
fn get_version(&self) -> Result<KeyStoreVersion, KeyStoreError>
[src]
fn set_version(&self, version: &KeyStoreVersion) -> Result<(), KeyStoreError>
[src]
fn key_for_info() -> Self::Key
[src]
fn key_for_snapshot() -> Self::Key
[src]
fn key_for_event(version: u64) -> Self::Key
[src]
fn key_for_command<S: WithStorableDetails>(
command: &StoredCommand<S>
) -> CommandKey
[src]
command: &StoredCommand<S>
) -> CommandKey
fn keys(&self, id: &Handle, matching: &str) -> Vec<Self::Key>
[src]
fn keys_ascending(&self, id: &Handle, matching: &str) -> Vec<Self::Key>
[src]
fn command_keys_ascending(
&self,
id: &Handle,
crit: &CommandHistoryCriteria
) -> Vec<CommandKey>
[src]
&self,
id: &Handle,
crit: &CommandHistoryCriteria
) -> Vec<CommandKey>
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 drop(&self, id: &Handle, key: &Self::Key) -> Result<(), KeyStoreError>
[src]
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<S: WithStorableDetails>(
&self,
command: StoredCommand<S>
) -> Result<(), KeyStoreError>
[src]
&self,
command: StoredCommand<S>
) -> Result<(), KeyStoreError>
fn get_aggregate<V: Aggregate>(
&self,
id: &Handle
) -> Result<Option<V>, KeyStoreError>
[src]
&self,
id: &Handle
) -> Result<Option<V>, KeyStoreError>
fn store_snapshot<V: Aggregate>(
&self,
id: &Handle,
aggregate: &V
) -> Result<(), KeyStoreError>
[src]
&self,
id: &Handle,
aggregate: &V
) -> Result<(), KeyStoreError>
fn get_info(&self, id: &Handle) -> Result<StoredValueInfo, KeyStoreError>
[src]
fn save_info(
&self,
id: &Handle,
info: &StoredValueInfo
) -> Result<(), KeyStoreError>
[src]
&self,
id: &Handle,
info: &StoredValueInfo
) -> Result<(), KeyStoreError>
fn command_history<A: Aggregate>(
&self,
id: &Handle,
crit: CommandHistoryCriteria
) -> Result<CommandHistory, KeyStoreError>
[src]
&self,
id: &Handle,
crit: CommandHistoryCriteria
) -> Result<CommandHistory, KeyStoreError>
Auto Trait Implementations
impl RefUnwindSafe for DiskKeyStore
impl Send for DiskKeyStore
impl Sync for DiskKeyStore
impl Unpin for DiskKeyStore
impl UnwindSafe for DiskKeyStore
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> 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 = Infallible
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>,