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 edges_by_property( &self, edge_type: &str, property: &str, value: &Property, ) -> Result<Vec<EdgeId>>

Relationship-scope analogue of Self::nodes_by_property. The planner only emits an EdgeSeek after confirming a (edge_type, property) index is registered via Self::list_edge_property_indexes. Default impl returns empty so readers that haven’t wired a native seek path degrade to no-results rather than mis-answering; the storage-backed blanket overrides with a real lookup.
Source§

fn list_property_indexes(&self) -> Result<Vec<(String, Vec<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, Vec<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_point_indexes(&self) -> Result<Vec<(String, String)>>

Snapshot the (label, property) pairs of every point / spatial index visible through this reader. Used by SHOW POINT INDEXES. Default impl returns empty; storage-backed readers override via the blanket impl.
Source§

fn list_edge_point_indexes(&self) -> Result<Vec<(String, String)>>

Relationship-scope analogue of Self::list_point_indexes. (edge_type, property) pairs. Default impl returns empty.
Source§

fn nodes_in_bbox( &self, label: &str, property: &str, srid: i32, xlo: f64, ylo: f64, xhi: f64, yhi: f64, ) -> Result<Vec<NodeId>>

Axis-aligned bounding-box range query over the point index (label, property). Returns every node carrying label whose property is a Property::Point under srid that falls inside [xlo..xhi] × [ylo..yhi]. Read more
Source§

fn edges_in_bbox( &self, edge_type: &str, property: &str, srid: i32, xlo: f64, ylo: f64, xhi: f64, yhi: f64, ) -> Result<Vec<EdgeId>>

Relationship-scope analogue of Self::nodes_in_bbox. Default impl returns empty — edge-scoped bbox queries aren’t yet part of the planner’s rewrite surface, so no read path exercises this on anything but the storage-backed blanket. When the edge point-seek lowering lands this default should grow a naive scan via edges_by_type (needs to be added to the trait first).
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)>>

Source§

fn nodes_by_properties( &self, label: &str, properties: &[String], values: &[Property], ) -> Result<Vec<NodeId>>

Composite form of Self::nodes_by_property. properties and values are parallel slices of equal length — every slot must be present for the call to land a match. The default impl delegates to nodes_by_property for length-1 slices and returns empty otherwise, so readers that haven’t wired a native composite seek degrade to no-results rather than mis-answering. The storage-backed blanket overrides with a real composite lookup.

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more