Skip to main content

StandardLibrary

Struct StandardLibrary 

Source
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 an EmptySchema. 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 StandardLibrary<EmptySchema>

Source

pub fn new() -> Self

Construct a stdlib-only provider (no labels, no procedures).

Source§

impl<S: SchemaProvider> StandardLibrary<S>

Source

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

Source

pub fn inner(&self) -> &S

Borrow the wrapped inner schema. Useful for callers that need raw access bypassing the stdlib overlay.

Source

pub fn builtin_names() -> Vec<&'static str>

All built-in function names, sorted. Stable across releases; exposed for completion and documentation consumers.

Source

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>

Source§

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

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

impl Default for StandardLibrary<EmptySchema>

Source§

fn default() -> Self

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

impl<S: SchemaProvider> SchemaProvider for StandardLibrary<S>

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

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