Trait radicle_cob::object::storage::Storage

source ·
pub trait Storage {
    type ObjectsError: Error + Send + Sync + 'static;
    type TypesError: Error + Send + Sync + 'static;
    type UpdateError: Error + Send + Sync + 'static;
    type RemoveError: Error + Send + Sync + 'static;

    // Required methods
    fn objects(
        &self,
        typename: &TypeName,
        object_id: &ObjectId,
    ) -> Result<Objects, Self::ObjectsError>;
    fn types(
        &self,
        typename: &TypeName,
    ) -> Result<BTreeMap<ObjectId, Objects>, Self::TypesError>;
    fn update(
        &self,
        identifier: &PublicKey,
        typename: &TypeName,
        object_id: &ObjectId,
        entry: &EntryId,
    ) -> Result<(), Self::UpdateError>;
    fn remove(
        &self,
        identifier: &PublicKey,
        typename: &TypeName,
        object_id: &ObjectId,
    ) -> Result<(), Self::RemoveError>;
}

Required Associated Types§

source

type ObjectsError: Error + Send + Sync + 'static

source

type TypesError: Error + Send + Sync + 'static

source

type UpdateError: Error + Send + Sync + 'static

source

type RemoveError: Error + Send + Sync + 'static

Required Methods§

source

fn objects( &self, typename: &TypeName, object_id: &ObjectId, ) -> Result<Objects, Self::ObjectsError>

Get all references which point to a head of the change graph for a particular object

source

fn types( &self, typename: &TypeName, ) -> Result<BTreeMap<ObjectId, Objects>, Self::TypesError>

Get all references to objects of a given type within a particular identity

source

fn update( &self, identifier: &PublicKey, typename: &TypeName, object_id: &ObjectId, entry: &EntryId, ) -> Result<(), Self::UpdateError>

Update a ref to a particular collaborative object

source

fn remove( &self, identifier: &PublicKey, typename: &TypeName, object_id: &ObjectId, ) -> Result<(), Self::RemoveError>

Remove a ref to a particular collaborative object

Implementors§