[][src]Trait holochain_persistence_api::eav::storage::EntityAttributeValueStorage

pub trait EntityAttributeValueStorage<A: Attribute>: Clone + Send + Sync + Debug + ReportStorage {
    fn add_eavi(
        &mut self,
        eav: &EntityAttributeValueIndex<A>
    ) -> PersistenceResult<Option<EntityAttributeValueIndex<A>>>;
fn fetch_eavi(
        &self,
        query: &EaviQuery<A>
    ) -> PersistenceResult<BTreeSet<EntityAttributeValueIndex<A>>>; }

This provides a simple and flexible interface to define relationships between AddressableContent. It does NOT provide storage for AddressableContent. Use cas::storage::ContentAddressableStorage to store AddressableContent.

Required methods

fn add_eavi(
    &mut self,
    eav: &EntityAttributeValueIndex<A>
) -> PersistenceResult<Option<EntityAttributeValueIndex<A>>>

Adds the given EntityAttributeValue to the EntityAttributeValueStorage append only storage.

fn fetch_eavi(
    &self,
    query: &EaviQuery<A>
) -> PersistenceResult<BTreeSet<EntityAttributeValueIndex<A>>>

Fetch the set of EntityAttributeValues that match constraints according to the latest hash version

  • None = no constraint
  • Some(Entity) = requires the given entity (e.g. all a/v pairs for the entity)
  • Some(Attribute) = requires the given attribute (e.g. all links)
  • Some(Value) = requires the given value (e.g. all entities referencing an Address)
Loading content...

Trait Implementations

impl<A: Attribute> PartialEq<dyn EntityAttributeValueStorage<A> + 'static> for dyn EntityAttributeValueStorage<A>[src]

Implementors

impl<A: Attribute> EntityAttributeValueStorage<A> for ExampleEntityAttributeValueStorage<A> where
    A: Send + Sync
[src]

Loading content...