pub trait EnvironmentStore: Sync + Send {
Show 14 methods
// Required methods
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<()>;
fn post_bundle_feedbacks_bytes_get(
&self,
post_bundle_location_id: &Id,
) -> Result<Bytes>;
fn post_feedback_put_if_more_powerful(
&self,
location_id: &Id,
encoded_post_feedback: &EncodedPostFeedbackV1,
) -> Result<()>;
// Provided methods
fn config_get_usize(&self, key: &str) -> Result<Option<usize>> { ... }
fn config_put_usize(&self, key: &str, v: usize) -> Result<()> { ... }
}Required Methods§
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<()>
Sourcefn 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
Returns a concatenated array of EncodedPostFeedbackV1 - may be []
Sourcefn 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