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§
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§
sourcefn objects(
&self,
typename: &TypeName,
object_id: &ObjectId,
) -> Result<Objects, Self::ObjectsError>
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
sourcefn types(
&self,
typename: &TypeName,
) -> Result<BTreeMap<ObjectId, Objects>, Self::TypesError>
fn types( &self, typename: &TypeName, ) -> Result<BTreeMap<ObjectId, Objects>, Self::TypesError>
Get all references to objects of a given type within a particular identity