Skip to main content

InMemorySchema

Struct InMemorySchema 

Source
pub struct InMemorySchema { /* private fields */ }
Expand description

A concrete, in-memory SchemaProvider.

Fields are pub(crate) — construction goes through InMemorySchema::builder or the TOML loader in crate::file. This keeps the invariants in one place (unique label / rel type names, deterministic iteration).

Implementations§

Source§

impl InMemorySchema

Source

pub fn builder() -> InMemorySchemaBuilder

Start a new builder. Use InMemorySchemaBuilder::build to finalise.

Source

pub fn label_names(&self) -> Vec<SmolStr>

All label names, in sorted order.

Source

pub fn rel_type_names(&self) -> Vec<SmolStr>

All relationship type names, in sorted order.

Source

pub fn rel_types(&self) -> impl Iterator<Item = &RelDecl>

All declared rel types, in sorted order.

Source

pub fn parameters(&self) -> impl Iterator<Item = &ParamDecl>

All declared parameters, in sorted order.

Source

pub fn schema_name(&self) -> Option<&str>

Optional human-readable schema name from the [meta] block.

Source

pub fn description(&self) -> Option<&str>

Optional human-readable description from the [meta] block.

Source

pub fn label_count(&self) -> usize

Count of labels.

Source

pub fn rel_type_count(&self) -> usize

Count of rel types.

Source

pub fn parameter_count(&self) -> usize

Count of parameters.

Trait Implementations§

Source§

impl Clone for InMemorySchema

Source§

fn clone(&self) -> InMemorySchema

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for InMemorySchema

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for InMemorySchema

Source§

fn default() -> InMemorySchema

Returns the “default value” for a type. Read more
Source§

impl SchemaProvider for InMemorySchema

Source§

fn labels(&self) -> Vec<SmolStr>

All declared labels. Order is not semantic; callers sort if they need deterministic output.
Source§

fn relationship_types(&self) -> Vec<SmolStr>

All declared relationship types.
Source§

fn node_properties(&self, label: &str) -> Option<Vec<PropertyDecl>>

Properties declared on a node with this label. Read more
Source§

fn relationship_properties(&self, rel_type: &str) -> Option<Vec<PropertyDecl>>

Properties declared on a relationship of this type.
Source§

fn relationship_endpoints(&self, rel_type: &str) -> Vec<EndpointDecl>

Declared endpoint pairs for a relationship type. Empty = endpoint- polymorphic; the semantic pass then skips endpoint checks.
Source§

fn inverse_of(&self, _rel_type: &str) -> Option<SmolStr>

Declared inverse relationship type, if any. Consumers that model typed inverses return them here; others return None.
Source§

fn function(&self, _name: &str) -> Option<FunctionSignature>

Look up a function signature. Used by typecheck and by completion.
Source§

fn procedure(&self, _name: &str) -> Option<ProcedureSignature>

Look up a procedure signature for CALL <proc>.
Source§

fn schema_digest(&self) -> [u8; 32]

A content-addressed digest of the schema’s observable surface. MUST change whenever any declaration visible through this trait changes.
Source§

fn has_label(&self, name: &str) -> bool

Convenience predicate: does the schema declare name as a label?
Source§

fn has_relationship_type(&self, name: &str) -> bool

Convenience predicate: does the schema declare name as a relationship type?

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.