Struct terminus_store::store::StoreLayer [−][src]
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]
&self,
subject: u64,
predicate: u64,
object: u64
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send>>
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]
&self,
subject: u64,
predicate: u64,
object: u64
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send>>
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]
&self
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
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]
&self
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
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]
&self,
subject: u64
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
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]
&self,
subject: u64
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
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]
&self,
subject: u64,
predicate: u64
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
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]
&self,
subject: u64,
predicate: u64
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
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]
&self,
predicate: u64
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
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]
&self,
predicate: u64
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
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]
&self,
object: u64
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
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]
&self,
object: u64
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Iterator<Item = IdTriple> + Send>>> + Send>>
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]
&self
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send>>
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]
&self
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send>>
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]
&self
) -> Pin<Box<dyn Future<Output = Result<Vec<[u32; 5]>>> + Send>>
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]
fn clone(&self) -> StoreLayer
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Layer for StoreLayer
[src]
fn name(&self) -> [u32; 5]
[src]
fn parent_name(&self) -> Option<[u32; 5]>
[src]
fn node_and_value_count(&self) -> usize
[src]
fn predicate_count(&self) -> usize
[src]
fn subject_id(&self, subject: &str) -> Option<u64>
[src]
fn predicate_id(&self, predicate: &str) -> Option<u64>
[src]
fn object_node_id(&self, object: &str) -> Option<u64>
[src]
fn object_value_id(&self, object: &str) -> Option<u64>
[src]
fn id_subject(&self, id: u64) -> Option<String>
[src]
fn id_predicate(&self, id: u64) -> Option<String>
[src]
fn id_object(&self, id: u64) -> Option<ObjectType>
[src]
fn triple_exists(&self, subject: u64, predicate: u64, object: u64) -> bool
[src]
fn triples(&self) -> Box<dyn Iterator<Item = IdTriple> + Send>
[src]
fn triples_s(&self, subject: u64) -> Box<dyn Iterator<Item = IdTriple> + Send>
[src]
fn triples_sp(
&self,
subject: u64,
predicate: u64
) -> Box<dyn Iterator<Item = IdTriple> + Send>
[src]
&self,
subject: u64,
predicate: u64
) -> Box<dyn Iterator<Item = IdTriple> + Send>
fn triples_p(&self, predicate: u64) -> Box<dyn Iterator<Item = IdTriple> + Send>
[src]
fn triples_o(&self, object: u64) -> Box<dyn Iterator<Item = IdTriple> + Send>
[src]
fn clone_boxed(&self) -> Box<dyn Layer>
[src]
fn triple_addition_count(&self) -> usize
[src]
fn triple_removal_count(&self) -> usize
[src]
fn all_counts(&self) -> LayerCounts
[src]
fn id_triple_exists(&self, triple: IdTriple) -> bool
[src]
fn string_triple_exists(&self, triple: &StringTriple) -> bool
[src]
fn string_triple_to_id(&self, triple: &StringTriple) -> Option<IdTriple>
[src]
fn string_triple_to_partially_resolved(
&self,
triple: StringTriple
) -> PartiallyResolvedTriple
[src]
&self,
triple: StringTriple
) -> PartiallyResolvedTriple
fn id_triple_to_string(&self, triple: &IdTriple) -> Option<StringTriple>
[src]
fn triple_count(&self) -> usize
[src]
Auto Trait Implementations
impl !RefUnwindSafe for StoreLayer
[src]
impl Send for StoreLayer
[src]
impl Sync for StoreLayer
[src]
impl Unpin for StoreLayer
[src]
impl !UnwindSafe for StoreLayer
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,