pub struct StandardLibrary<S: SchemaProvider = EmptySchema> { /* private fields */ }Expand description
The openCypher built-in function catalog as a SchemaProvider.
Two constructors:
StandardLibrary::new— stdlib only; labels, endpoints, etc. delegate to anEmptySchema. Suitable for schema-free mode (spec §8.4).StandardLibrary::wrap— stdlib ∪ consumer schema. Function lookup consults the stdlib first; all other surface delegates to the wrapped schema.
The type is generic over the inner provider so the composition is
zero-cost. A Box<dyn SchemaProvider> also satisfies
SchemaProvider (object-safe per spec §8.1), which makes the
dynamic form ergonomic.
Implementations§
Source§impl<S: SchemaProvider> StandardLibrary<S>
impl<S: SchemaProvider> StandardLibrary<S>
Sourcepub fn wrap(inner: S) -> Self
pub fn wrap(inner: S) -> Self
Wrap a consumer schema so function lookups see stdlib ∪ inner.
Stdlib names shadow consumer declarations for the same name. Consumers MUST NOT redefine openCypher built-ins (spec §8.3).
Sourcepub fn inner(&self) -> &S
pub fn inner(&self) -> &S
Borrow the wrapped inner schema. Useful for callers that need raw access bypassing the stdlib overlay.
Sourcepub fn builtin_names() -> Vec<&'static str>
pub fn builtin_names() -> Vec<&'static str>
All built-in function names, sorted. Stable across releases; exposed for completion and documentation consumers.
Sourcepub fn builtin_count() -> usize
pub fn builtin_count() -> usize
Number of built-ins in the catalog. Test-facing shape check.
Trait Implementations§
Source§impl<S: SchemaProvider + Debug> Debug for StandardLibrary<S>
impl<S: SchemaProvider + Debug> Debug for StandardLibrary<S>
Source§impl Default for StandardLibrary<EmptySchema>
impl Default for StandardLibrary<EmptySchema>
Source§impl<S: SchemaProvider> SchemaProvider for StandardLibrary<S>
impl<S: SchemaProvider> SchemaProvider for StandardLibrary<S>
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 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?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.
Auto Trait Implementations§
impl<S> Freeze for StandardLibrary<S>where
S: Freeze,
impl<S> RefUnwindSafe for StandardLibrary<S>where
S: RefUnwindSafe,
impl<S> Send for StandardLibrary<S>
impl<S> Sync for StandardLibrary<S>
impl<S> Unpin for StandardLibrary<S>where
S: Unpin,
impl<S> UnsafeUnpin for StandardLibrary<S>where
S: UnsafeUnpin,
impl<S> UnwindSafe for StandardLibrary<S>where
S: UnwindSafe,
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