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
impl InMemorySchema
Sourcepub fn builder() -> InMemorySchemaBuilder
pub fn builder() -> InMemorySchemaBuilder
Start a new builder. Use InMemorySchemaBuilder::build to
finalise.
Sourcepub fn label_names(&self) -> Vec<SmolStr>
pub fn label_names(&self) -> Vec<SmolStr>
All label names, in sorted order.
Sourcepub fn rel_type_names(&self) -> Vec<SmolStr>
pub fn rel_type_names(&self) -> Vec<SmolStr>
All relationship type names, in sorted order.
Sourcepub fn rel_types(&self) -> impl Iterator<Item = &RelDecl>
pub fn rel_types(&self) -> impl Iterator<Item = &RelDecl>
All declared rel types, in sorted order.
Sourcepub fn parameters(&self) -> impl Iterator<Item = &ParamDecl>
pub fn parameters(&self) -> impl Iterator<Item = &ParamDecl>
All declared parameters, in sorted order.
Sourcepub fn schema_name(&self) -> Option<&str>
pub fn schema_name(&self) -> Option<&str>
Optional human-readable schema name from the [meta] block.
Sourcepub fn description(&self) -> Option<&str>
pub fn description(&self) -> Option<&str>
Optional human-readable description from the [meta] block.
Sourcepub fn label_count(&self) -> usize
pub fn label_count(&self) -> usize
Count of labels.
Sourcepub fn rel_type_count(&self) -> usize
pub fn rel_type_count(&self) -> usize
Count of rel types.
Sourcepub fn parameter_count(&self) -> usize
pub fn parameter_count(&self) -> usize
Count of parameters.
Trait Implementations§
Source§impl Clone for InMemorySchema
impl Clone for InMemorySchema
Source§fn clone(&self) -> InMemorySchema
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InMemorySchema
impl Debug for InMemorySchema
Source§impl Default for InMemorySchema
impl Default for InMemorySchema
Source§fn default() -> InMemorySchema
fn default() -> InMemorySchema
Returns the “default value” for a type. Read more
Source§impl SchemaProvider for InMemorySchema
impl SchemaProvider for InMemorySchema
Source§fn labels(&self) -> Vec<SmolStr>
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>
fn relationship_types(&self) -> Vec<SmolStr>
All declared relationship types.
Source§fn node_properties(&self, label: &str) -> Option<Vec<PropertyDecl>>
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>>
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>
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>
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>
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>
fn procedure(&self, _name: &str) -> Option<ProcedureSignature>
Look up a procedure signature for
CALL <proc>.Source§fn schema_digest(&self) -> [u8; 32]
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
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
fn has_relationship_type(&self, name: &str) -> bool
Convenience predicate: does the schema declare
name as a
relationship type?Auto Trait Implementations§
impl Freeze for InMemorySchema
impl RefUnwindSafe for InMemorySchema
impl Send for InMemorySchema
impl Sync for InMemorySchema
impl Unpin for InMemorySchema
impl UnsafeUnpin for InMemorySchema
impl UnwindSafe for InMemorySchema
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