[][src]Trait terminus_store::layer::LayerSubjectPredicateLookup

pub trait LayerSubjectPredicateLookup {
    fn subject(&self) -> u64;
fn predicate(&self) -> u64;
fn objects(&self) -> Box<dyn Iterator<Item = u64>>;
fn has_object(&self, object: u64) -> bool; fn triples(&self) -> Box<dyn Iterator<Item = IdTriple>> { ... }
fn triple(&self, object: u64) -> Option<IdTriple> { ... } }

a trait that caches a lookup in a layer by subject and predicate, but only for that layer and not its parents.

This is returned by SubjectLookup::predicates and SubjectLookup::lookup_predicate. It stores slices of the relevant data structures to allow quick retrieval of objects when one already knows the subject and predicate.

Required methods

fn subject(&self) -> u64

The subject that this lookup is based on.

fn predicate(&self) -> u64

The predicate that this lookup is based on.

fn objects(&self) -> Box<dyn Iterator<Item = u64>>

Returns an iterator over all objects that can be found by this lookup.

fn has_object(&self, object: u64) -> bool

Returns true if the given object exists, and false otherwise.

Loading content...

Provided methods

fn triples(&self) -> Box<dyn Iterator<Item = IdTriple>>

Returns an iterator over all triples that can be found by this lookup.

fn triple(&self, object: u64) -> Option<IdTriple>

Returns a triple for the given object, or None if it doesn't exist.

Loading content...

Implementors

Loading content...