Struct terminus_store::store::StoreLayer[][src]

pub struct StoreLayer { /* 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 StoreLayer will dynamically load in the relevant files to perform the requested addition or removal query method.

Implementations

impl StoreLayer[src]

pub async fn open_write(&self) -> Result<StoreLayerBuilder>[src]

Create a layer builder based on this layer.

pub async fn parent(&self) -> Result<Option<StoreLayer>>[src]

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

pub async fn squash(&self) -> Result<StoreLayer>[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 async fn rollup(&self) -> Result<()>[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 async fn rollup_upto(&self, upto: &StoreLayer) -> Result<()>[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 triple_addition_exists(
    &self,
    subject: u64,
    predicate: u64,
    object: u64
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send>>
[src]

Returns a future that yields 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
) -> Pin<Box<dyn Future<Output = Result<Vec<[u32; 5]>>> + Send>>
[src]

Returns a future that yields 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 StoreLayer[src]

impl Layer for StoreLayer[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>,