Skip to main content

ObjectStore

Trait ObjectStore 

Source
pub trait ObjectStore {
    // Required methods
    fn try_get_object(&self, object_id: &ObjectId) -> Result<Option<Object>>;
    fn try_get_object_by_key(
        &self,
        object_id: &ObjectId,
        version: VersionNumber,
    ) -> Result<Option<Object>>;

    // Provided methods
    fn get_object(&self, object_id: &ObjectId) -> Option<Object> { ... }
    fn get_object_by_key(
        &self,
        object_id: &ObjectId,
        version: VersionNumber,
    ) -> Option<Object> { ... }
    fn try_multi_get_objects(
        &self,
        object_ids: &[ObjectId],
    ) -> Result<Vec<Option<Object>>> { ... }
    fn multi_get_objects(&self, object_ids: &[ObjectId]) -> Vec<Option<Object>> { ... }
    fn try_multi_get_objects_by_key(
        &self,
        object_keys: &[ObjectKey],
    ) -> Result<Vec<Option<Object>>> { ... }
    fn multi_get_objects_by_key(
        &self,
        object_keys: &[ObjectKey],
    ) -> Vec<Option<Object>> { ... }
}

Required Methods§

Source

fn try_get_object(&self, object_id: &ObjectId) -> Result<Option<Object>>

Source

fn try_get_object_by_key( &self, object_id: &ObjectId, version: VersionNumber, ) -> Result<Option<Object>>

Provided Methods§

Source

fn get_object(&self, object_id: &ObjectId) -> Option<Object>

Non-fallible version of try_get_object.

Source

fn get_object_by_key( &self, object_id: &ObjectId, version: VersionNumber, ) -> Option<Object>

Non-fallible version of try_get_object_by_key.

Source

fn try_multi_get_objects( &self, object_ids: &[ObjectId], ) -> Result<Vec<Option<Object>>>

Source

fn multi_get_objects(&self, object_ids: &[ObjectId]) -> Vec<Option<Object>>

Non-fallible version of try_multi_get_objects.

Source

fn try_multi_get_objects_by_key( &self, object_keys: &[ObjectKey], ) -> Result<Vec<Option<Object>>>

Source

fn multi_get_objects_by_key( &self, object_keys: &[ObjectKey], ) -> Vec<Option<Object>>

Non-fallible version of try_multi_get_objects_by_key.

Implementations on Foreign Types§

Source§

impl ObjectStore for &[Object]

Source§

fn try_get_object(&self, object_id: &ObjectId) -> Result<Option<Object>>

Source§

fn try_get_object_by_key( &self, object_id: &ObjectId, version: VersionNumber, ) -> Result<Option<Object>>

Source§

impl ObjectStore for BTreeMap<ObjectId, (ObjectRef, Object, WriteKind)>

Source§

fn try_get_object(&self, object_id: &ObjectId) -> Result<Option<Object>>

Source§

fn try_get_object_by_key( &self, object_id: &ObjectId, version: VersionNumber, ) -> Result<Option<Object>>

Source§

impl ObjectStore for BTreeMap<ObjectId, Object>

Source§

fn try_get_object(&self, object_id: &ObjectId) -> Result<Option<Object>>

Source§

fn try_get_object_by_key( &self, object_id: &ObjectId, version: VersionNumber, ) -> Result<Option<Object>>

Source§

impl<T: ObjectStore + ?Sized> ObjectStore for &T

Source§

fn try_get_object(&self, object_id: &ObjectId) -> Result<Option<Object>>

Source§

fn try_get_object_by_key( &self, object_id: &ObjectId, version: VersionNumber, ) -> Result<Option<Object>>

Source§

fn try_multi_get_objects( &self, object_ids: &[ObjectId], ) -> Result<Vec<Option<Object>>>

Source§

fn try_multi_get_objects_by_key( &self, object_keys: &[ObjectKey], ) -> Result<Vec<Option<Object>>>

Source§

impl<T: ObjectStore + ?Sized> ObjectStore for Box<T>

Source§

fn try_get_object(&self, object_id: &ObjectId) -> Result<Option<Object>>

Source§

fn try_get_object_by_key( &self, object_id: &ObjectId, version: VersionNumber, ) -> Result<Option<Object>>

Source§

fn try_multi_get_objects( &self, object_ids: &[ObjectId], ) -> Result<Vec<Option<Object>>>

Source§

fn try_multi_get_objects_by_key( &self, object_keys: &[ObjectKey], ) -> Result<Vec<Option<Object>>>

Source§

impl<T: ObjectStore + ?Sized> ObjectStore for Arc<T>

Source§

fn try_get_object(&self, object_id: &ObjectId) -> Result<Option<Object>>

Source§

fn try_get_object_by_key( &self, object_id: &ObjectId, version: VersionNumber, ) -> Result<Option<Object>>

Source§

fn try_multi_get_objects( &self, object_ids: &[ObjectId], ) -> Result<Vec<Option<Object>>>

Source§

fn try_multi_get_objects_by_key( &self, object_keys: &[ObjectKey], ) -> Result<Vec<Option<Object>>>

Implementors§