pub struct MemEnvironmentStore { /* private fields */ }Expand description
MemEnvironmentStore implements the EnvironmentStore trait for use during testing. Everything is stored in memory and is volatile to restarts.
Trait Implementations§
Source§impl EnvironmentStore for MemEnvironmentStore
impl EnvironmentStore for MemEnvironmentStore
fn post_bundle_count(&self) -> Result<usize>
fn post_bundle_metadata_get( &self, location_id: &Id, ) -> Result<Option<PostBundleMetadata>>
fn post_bundle_metadata_put( &self, location_id: &Id, post_bundle_metadata: &PostBundleMetadata, ) -> Result<()>
fn post_bundle_bytes_get(&self, location_id: &Id) -> Result<Option<Bytes>>
fn post_bundle_bytes_put(&self, location_id: &Id, bytes: &[u8]) -> Result<()>
fn post_bundles_last_accessed_flush( &self, post_bundles_last_accessed: &HashMap<Id, TimeMillis>, ) -> Result<()>
fn post_bundles_delete(&self, location_ids: &[Id]) -> Result<()>
fn post_bundles_last_accessed_iter( &self, location_id: &Id, ) -> Box<dyn Iterator<Item = Result<(Id, TimeMillisBytes), Error>> + '_>
fn config_get_bytes(&self, key: &str) -> Result<Option<Vec<u8>>>
fn config_put_bytes(&self, key: &str, v: Vec<u8>) -> Result<()>
Source§fn post_bundle_feedbacks_bytes_get(
&self,
post_bundle_location_id: &Id,
) -> Result<Bytes>
fn post_bundle_feedbacks_bytes_get( &self, post_bundle_location_id: &Id, ) -> Result<Bytes>
Get all the feedbacks for a given post_bundle_location_id Read more
Source§fn post_feedback_put_if_more_powerful(
&self,
location_id: &Id,
encoded_post_feedback: &EncodedPostFeedbackV1,
) -> Result<()>
fn post_feedback_put_if_more_powerful( &self, location_id: &Id, encoded_post_feedback: &EncodedPostFeedbackV1, ) -> Result<()>
Stores the post feedback if it is more powerful than the current feedback
fn config_get_usize(&self, key: &str) -> Result<Option<usize>>
fn config_put_usize(&self, key: &str, v: usize) -> Result<()>
Auto Trait Implementations§
impl !Freeze for MemEnvironmentStore
impl !RefUnwindSafe for MemEnvironmentStore
impl Send for MemEnvironmentStore
impl Sync for MemEnvironmentStore
impl Unpin for MemEnvironmentStore
impl UnsafeUnpin for MemEnvironmentStore
impl UnwindSafe for MemEnvironmentStore
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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