pub struct StorageReaderAdapter<'a>(pub &'a dyn StorageEngine);Expand description
Adapter that lets a &dyn StorageEngine act as a GraphReader.
Needed because trait objects of unrelated traits don’t coerce —
see the note on the blanket impl<T: StorageEngine> GraphReader for T.
Wraps a trait-object reference; no heap allocation. Works for both
reads and writes via the sibling crate::writer::StorageWriterAdapter.
Tuple Fields§
§0: &'a dyn StorageEngineTrait Implementations§
Source§impl GraphReader for StorageReaderAdapter<'_>
impl GraphReader for StorageReaderAdapter<'_>
fn get_node(&self, id: NodeId) -> Result<Option<Node>>
fn get_edge(&self, id: EdgeId) -> Result<Option<Edge>>
fn all_node_ids(&self) -> Result<Vec<NodeId>>
fn nodes_by_label(&self, label: &str) -> Result<Vec<NodeId>>
Source§fn nodes_by_property(
&self,
label: &str,
property: &str,
value: &Property,
) -> Result<Vec<NodeId>>
fn nodes_by_property( &self, label: &str, property: &str, value: &Property, ) -> Result<Vec<NodeId>>
Equality lookup via a property index. Callers (planner) must
have verified the
(label, property) index exists before
emitting this call — fallback implementations are free to do a
label-scan-and-filter for impls that don’t maintain their own
property index, but the storage-backed reader treats a call on
a non-existent index as an empty result since no entries are
maintained.Source§fn list_property_indexes(&self) -> Result<Vec<(String, String)>>
fn list_property_indexes(&self) -> Result<Vec<(String, String)>>
Snapshot the
(label, property) pairs of every property
index visible through this reader. Used by SHOW INDEXES.
Default impl returns empty — the storage-backed reader
overrides via the blanket impl, and partitioned/overlay
readers delegate to their bases.Source§fn list_edge_property_indexes(&self) -> Result<Vec<(String, String)>>
fn list_edge_property_indexes(&self) -> Result<Vec<(String, String)>>
Relationship-scope analogue of
Self::list_property_indexes.
Returns (edge_type, property) pairs for every registered
edge property index. Default impl returns empty; overlay
and partitioned readers delegate to their bases.Source§fn list_property_constraints(&self) -> Result<Vec<PropertyConstraintSpec>>
fn list_property_constraints(&self) -> Result<Vec<PropertyConstraintSpec>>
Snapshot every registered constraint visible through this
reader, for
SHOW CONSTRAINTS and db.constraints(). Default
impl returns empty; storage-backed readers override.fn outgoing(&self, id: NodeId) -> Result<Vec<(EdgeId, NodeId)>>
fn incoming(&self, id: NodeId) -> Result<Vec<(EdgeId, NodeId)>>
Auto Trait Implementations§
impl<'a> Freeze for StorageReaderAdapter<'a>
impl<'a> !RefUnwindSafe for StorageReaderAdapter<'a>
impl<'a> Send for StorageReaderAdapter<'a>
impl<'a> Sync for StorageReaderAdapter<'a>
impl<'a> Unpin for StorageReaderAdapter<'a>
impl<'a> UnsafeUnpin for StorageReaderAdapter<'a>
impl<'a> !UnwindSafe for StorageReaderAdapter<'a>
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