Skip to main content

StorageReaderAdapter

Struct StorageReaderAdapter 

Source
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 StorageEngine

Trait Implementations§

Source§

impl GraphReader for StorageReaderAdapter<'_>

Source§

fn get_node(&self, id: NodeId) -> Result<Option<Node>>

Source§

fn get_edge(&self, id: EdgeId) -> Result<Option<Edge>>

Source§

fn all_node_ids(&self) -> Result<Vec<NodeId>>

Source§

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

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

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

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

Snapshot every registered constraint visible through this reader, for SHOW CONSTRAINTS and db.constraints(). Default impl returns empty; storage-backed readers override.
Source§

fn outgoing(&self, id: NodeId) -> Result<Vec<(EdgeId, NodeId)>>

Source§

fn incoming(&self, id: NodeId) -> Result<Vec<(EdgeId, NodeId)>>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.