pub struct MemoryStore { /* private fields */ }Expand description
The in-memory reference implementation of JournalStore and GraphStore on one
dataset, used by the test kit’s self-test and by tests of code above the storage layer.
Like the tiramemsu backend, it holds the journal and the graphs in one store: an append writes the entry graphs and the state delta into the dataset under one lock. By default it enforces fencing, accepts state deltas and declares RDF 1.2; each can be switched off to exercise the other side of a capability.
Implementations§
Source§impl MemoryStore
impl MemoryStore
Sourcepub fn with_fencing(self, on: bool) -> Self
pub fn with_fencing(self, on: bool) -> Self
This store with fencing enforced or not.
Sourcepub fn with_state_in_append(self, on: bool) -> Self
pub fn with_state_in_append(self, on: bool) -> Self
This store with state deltas accepted or not.
Sourcepub fn with_rdf(self, rdf: RdfCapability) -> Self
pub fn with_rdf(self, rdf: RdfCapability) -> Self
This store declaring rdf. With RdfCapability::Rdf11 it refuses triple terms.
Trait Implementations§
Source§impl Debug for MemoryStore
impl Debug for MemoryStore
Source§impl Default for MemoryStore
impl Default for MemoryStore
Source§impl GraphStore for MemoryStore
impl GraphStore for MemoryStore
Source§fn capabilities(&self) -> GraphCapabilities
fn capabilities(&self) -> GraphCapabilities
What the store declares about itself.
Source§fn insert_quads(&self, quads: &[Quad]) -> Result<(), StoreError>
fn insert_quads(&self, quads: &[Quad]) -> Result<(), StoreError>
Adds
quads. Read moreSource§fn remove_quads(&self, quads: &[Quad]) -> Result<(), StoreError>
fn remove_quads(&self, quads: &[Quad]) -> Result<(), StoreError>
Removes
quads (absent ones are ignored). Blank nodes cannot be named for removal. Read moreSource§fn clear_graph(&self, graph: &NamedNode) -> Result<(), StoreError>
fn clear_graph(&self, graph: &NamedNode) -> Result<(), StoreError>
Removes every statement of the named graph
graph. Read moreSource§fn query(&self, sparql: &str) -> Result<QueryResults, StoreError>
fn query(&self, sparql: &str) -> Result<QueryResults, StoreError>
Source§fn rdf_capability(&self) -> RdfCapability
fn rdf_capability(&self) -> RdfCapability
Whether the store supports RDF 1.2 triple terms.
Source§impl JournalStore for MemoryStore
impl JournalStore for MemoryStore
Source§fn capabilities(&self) -> JournalCapabilities
fn capabilities(&self) -> JournalCapabilities
What the store supports beyond compare-and-set.
Source§fn append(
&self,
actor: &NamedNode,
expected: Position,
entries: &[Entry],
meta: &AppendMeta,
) -> Result<Position, AppendError>
fn append( &self, actor: &NamedNode, expected: Position, entries: &[Entry], meta: &AppendMeta, ) -> Result<Position, AppendError>
Source§fn read(
&self,
actor: &NamedNode,
from: Position,
) -> Result<Vec<JournalRecord>, StoreError>
fn read( &self, actor: &NamedNode, from: Position, ) -> Result<Vec<JournalRecord>, StoreError>
The entries of
actor’s journal from position from (inclusive; 0 reads from the
start) to the head, in order. Read moreSource§fn head(&self, actor: &NamedNode) -> Result<Position, StoreError>
fn head(&self, actor: &NamedNode) -> Result<Position, StoreError>
The position of
actor’s last entry, 0 for an empty journal. Read moreSource§fn actors(&self) -> Result<Vec<NamedNode>, StoreError>
fn actors(&self) -> Result<Vec<NamedNode>, StoreError>
Every actor with at least one entry. Read more
Source§fn supports_fencing(&self) -> bool
fn supports_fencing(&self) -> bool
True when the store enforces fencing tokens.
Auto Trait Implementations§
impl !Freeze for MemoryStore
impl Forget for MemoryStore
impl Move for MemoryStore
impl RefUnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
impl UnwindSafe for MemoryStore
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more