Struct terminus_store::store::sync::SyncStoreLayer[][src]

pub struct SyncStoreLayer { /* fields omitted */ }

A layer that keeps track of the store it came out of, allowing the creation of a layer builder on top of this layer.

This type of layer supports querying what was added and what was removed in this layer. This can not be done in general, because the layer that has been loaded may not be the layer that was originally built. This happens whenever a rollup is done. A rollup will create a new layer that bundles the changes of various layers. It allows for more efficient querying, but loses the ability to do these delta queries directly. In order to support them anyway, the SyncStoreLayer will dynamically load in the relevant files to perform the requested addition or removal query method.

Implementations

impl SyncStoreLayer[src]

pub fn open_write(&self) -> Result<SyncStoreLayerBuilder, Error>[src]

Create a layer builder based on this layer.

pub fn parent(&self) -> Result<Option<SyncStoreLayer>, Error>[src]

Returns the parent of this layer, if any, or None if this layer has no parent.

pub fn squash(&self) -> Result<SyncStoreLayer, Error>[src]

Create a new base layer consisting of all triples in this layer, as well as all its ancestors.

It is a good idea to keep layer stacks small, meaning, to only have a handful of ancestors for a layer. The more layers there are, the longer queries take. Squash is one approach of accomplishing this. Rollup is another. Squash is the better option if you do not care for history, as it throws away all data that you no longer need.

pub fn rollup(&self) -> Result<(), Error>[src]

Create a new rollup layer which rolls up all triples in this layer, as well as all its ancestors.

It is a good idea to keep layer stacks small, meaning, to only have a handful of ancestors for a layer. The more layers there are, the longer queries take. Rollup is one approach of accomplishing this. Squash is another. Rollup is the better option if you need to retain history.

pub fn rollup_upto(&self, upto: &SyncStoreLayer) -> Result<(), Error>[src]

Create a new rollup layer which rolls up all triples in this layer, as well as all ancestors up to (but not including) the given ancestor.

It is a good idea to keep layer stacks small, meaning, to only have a handful of ancestors for a layer. The more layers there are, the longer queries take. Rollup is one approach of accomplishing this. Squash is another. Rollup is the better option if you need to retain history.

pub fn imprecise_rollup_upto(&self, upto: &SyncStoreLayer) -> Result<(), Error>[src]

Like rollup_upto, rolls up upto the given layer. However, if this layer is a rollup layer, this will roll up upto that rollup.

pub fn triple_addition_exists(
    &self,
    subject: u64,
    predicate: u64,
    object: u64
) -> Result<bool>
[src]

Returns true if this triple has been added in this layer, or false if it doesn’t.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_removal_exists(
    &self,
    subject: u64,
    predicate: u64,
    object: u64
) -> Result<bool>
[src]

Returns true if this triple has been removed in this layer, or false if it doesn’t.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_additions(
    &self
) -> Result<Box<dyn Iterator<Item = IdTriple> + Send>>
[src]

Returns an iterator over all layer additions.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_removals(
    &self
) -> Result<Box<dyn Iterator<Item = IdTriple> + Send>>
[src]

Returns an iterator over all layer removals.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_additions_s(
    &self,
    subject: u64
) -> Result<Box<dyn Iterator<Item = IdTriple> + Send>>
[src]

Returns an iterator over all layer additions that share a particular subject.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_removals_s(
    &self,
    subject: u64
) -> Result<Box<dyn Iterator<Item = IdTriple> + Send>>
[src]

Returns an iterator over all layer removals that share a particular subject.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_additions_sp(
    &self,
    subject: u64,
    predicate: u64
) -> Result<Box<dyn Iterator<Item = IdTriple> + Send>>
[src]

Returns an iterator over all layer additions that share a particular subject and predicate.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_removals_sp(
    &self,
    subject: u64,
    predicate: u64
) -> Result<Box<dyn Iterator<Item = IdTriple> + Send>>
[src]

Returns an iterator over all layer removals that share a particular subject and predicate.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_additions_p(
    &self,
    predicate: u64
) -> Result<Box<dyn Iterator<Item = IdTriple> + Send>>
[src]

Returns an iterator over all layer additions that share a particular predicate.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_removals_p(
    &self,
    predicate: u64
) -> Result<Box<dyn Iterator<Item = IdTriple> + Send>>
[src]

Returns an iterator over all layer removals that share a particular predicate.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_additions_o(
    &self,
    object: u64
) -> Result<Box<dyn Iterator<Item = IdTriple> + Send>>
[src]

Returns an iterator over all layer additions that share a particular object.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_removals_o(
    &self,
    object: u64
) -> Result<Box<dyn Iterator<Item = IdTriple> + Send>>
[src]

Returns an iterator over all layer removals that share a particular object.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_layer_addition_count(&self) -> Result<usize>[src]

Returns the amount of triples that this layer adds.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn triple_layer_removal_count(&self) -> Result<usize>[src]

Returns the amount of triples that this layer removes.

Since this operation will involve io when this layer is a rollup layer, io errors may occur.

pub fn retrieve_layer_stack_names(&self) -> Result<Vec<[u32; 5]>>[src]

Returns a vector of layer stack names describing the history of this layer, starting from the base layer up to and including the name of this layer itself.

Trait Implementations

impl Clone for SyncStoreLayer[src]

impl Layer for SyncStoreLayer[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,