Struct terminus_store::store::StoreLayerBuilder[][src]

pub struct StoreLayerBuilder { /* fields omitted */ }

A wrapper over a SimpleLayerBuilder, providing a thread-safe sharable interface.

The SimpleLayerBuilder requires one to have a mutable reference to the underlying LayerBuilder, and on commit it will be consumed. This builder only requires an immutable reference, and uses a futures-aware read-write lock to synchronize access to it between threads. Also, rather than consuming itself on commit, this wrapper will simply mark itself as having committed, returning errors on further calls.

Implementations

impl StoreLayerBuilder[src]

pub fn name(&self) -> [u32; 5][src]

Returns the name of the layer being built.

pub fn parent(&self) -> Option<Arc<dyn Layer>>[src]

Returns the parent layer this builder is building on top of, if any.

If there's no parent, this returns None.

pub fn add_string_triple(&self, triple: StringTriple) -> Result<(), Error>[src]

Add a string triple.

pub fn add_id_triple(&self, triple: IdTriple) -> Result<(), Error>[src]

Add an id triple.

pub fn remove_string_triple(&self, triple: StringTriple) -> Result<(), Error>[src]

Remove a string triple.

pub fn remove_id_triple(&self, triple: IdTriple) -> Result<(), Error>[src]

Remove an id triple.

pub fn committed(&self) -> bool[src]

Returns true if this layer has been committed, and false otherwise.

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

Commit the layer to storage without loading the resulting layer.

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

Commit the layer to storage.

pub async fn apply_delta(&self, delta: &StoreLayer) -> Result<(), Error>[src]

Apply all triples added and removed by a layer to this builder.

This is a way to 'cherry-pick' a layer on top of another layer, without caring about its history.

pub fn apply_diff(&self, other: &StoreLayer) -> Result<(), Error>[src]

Apply the changes required to change our parent layer into the given layer.

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, 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>,