Skip to main content

Crate relate_core

Crate relate_core 

Source
Expand description

Core values, errors, and identifiers for Relate.

Re-exports§

pub use temporal::QueryClockGuard;
pub use temporal::Temporal;
pub use tokens::ExecutionReceipt;
pub use tokens::TokenEstimate;
pub use tokens::TokenOutcome;

Modules§

ce_messages
Neo4j Community Edition error texts for the fixed namespaces (ADR-0116 §2-§4, §9; ADR-0146).
file_identity
Physical file identity for storage ownership (ADR-0097) and LOAD CSV open-then-verify (ADR-0108).
integer_args
The ADR-0175 integer-argument sites’ authored texts.
temporal
OpenCypher temporal values (ADR-0021).
tokens
Logical workspace charging. The logical workspace is the owned resident memory a query holds, measured in logical bytes. The pool reserves that memory in CHARGE_QUANTUM_BYTES steps, so every reservation and every receipt peak is a multiple of the quantum. Receipts report that peak and carry no schedule name. With no ledger installed, every charge is a no-op so admission can stay off.

Structs§

ArityContract
One builtin’s compile-phase arity contract: the accepted argument-count range together with the authored rejection detail (bare, without the class token). Declared in the shared contract layer so the front-end check, the planner’s rule table and the executor’s dispatch read one fact instead of a count and a message each.
AutoLiteralGuard
Installs params for the guard’s lifetime. A map with no $__AUTO_*__ name installs nothing: a caller’s own parameters stay runtime-typed.
CancelToken
A cooperative cancellation flag shared between a query’s caller and the worker executing it (ADR-0111).
ElementIdRef
The parsed shape of an element id (ADR-0116 §7): <kind>:<segment>:<n|r><id>. This is the one parser for that three-part structure, shared by USE graph.byElementId(...) resolution and db.nameFromElementId; it only splits the shape — callers decide how much of it to validate (db.nameFromElementId checks the kind prefix and rejects an empty entity segment, but deliberately does not validate the entity segment’s contents).
Node
Path
PointValue
Cypher point value with SRID and 2D/3D coordinates.
PresenceBits
One bit per logical slot, packed little-endian into u64 words.
PreviewFeatures
The set of preview features enabled by RELATE_PREVIEW for one open store. Empty (PreviewFeatures::none) disables every gated feature.
PropertyMap
Sorted (key, value) entries with capacity fitted to [reserved_slot_count].
Relationship
TaggedStr
Borrowing encoder of the tagged string {"t":"string","v":...}. Construct it with tagged_str. Value’s tagged encoder writes the same two entries.

Enums§

ArithmeticFailure
The arithmetic failures the executor raises (ADR-0307), typed so a surface maps them without reading the message. Each renders exactly as the stringly error it replaced did.
CapacityKind
Which capacity contract a Error::Capacity refusal belongs to (ADR-0042/ADR-0307 vs ADR-0463 vs ADR-0494). Public so a consumer can render the class without parsing the message; the Display already differs.
DynamicAccessError
One rejected dynamic operand, carrying the data both error channels need (the front renders it as an EngineError (relate-error), the executor as a Error). Display is the authored detail text.
DynamicNameToken
Which token namespace a dynamic name belongs to (the tokenType slot of Neo4j’s 42I11 “invalid name” status description). Owns the whole namespace vocabulary — the 42I11 token phrase, the 22N27/22NB1 operand position and accepted type — so neither layer spells any of them.
Error
ErrorKind
The specific, TCK-aligned name of an engine error. kind() returns the most specific name available; nested detail (e.g. the UnsupportedIndexOrConstraint in "SyntaxError: UnsupportedIndexOrConstraint: …") stays in the message.
Namespace
One of the three fixed namespaces of a store.
PreviewFeature
A gated preview Cypher feature. The table order is the registry order; rows are never renumbered, only appended.
TckErrorClass
One of the eight openCypher TCK error classes. The spec harness (ADR-0482) asserts an expected class, while ErrorKind carries the finer-grained detail. Every ErrorKind maps to exactly one class via ErrorKind::tck_class.
Value
OpenCypher runtime value.
VectorCoordKind
A vector coordinate type (CIP-216/CIP-200): the numeric types valid inside VECTOR<...>/VECTOR(...). Int64/Float64 double as ordinary plain property types (aliases for INTEGER/FLOAT) outside a vector type; the others (Float16, BFloat16, Float32, Int8/Int16/ Int32) are valid only as a vector coordinate type. Lives in relate-model (rather than the parser, where it originated) so the runtime CypherValue::Vector variant can carry it without a circular crate dependency – the parser re-exports this same type as relate_parser::VectorCoordKind.

Constants§

CHAR_LENGTH_ARITY
char_length()/character_length()’s one-argument contract.
FORMAT_ARITY
format()’s one-or-two-argument contract.
FORMAT_REQUIRES_ONE_OR_TWO_ARGUMENTS
The one spelling of format()’s one-or-two-argument arity requirement, shared by the front-end check and the executor’s implementation.
FUNCTION_REQUIRES_ONE_ARGUMENT
The one spelling of the one-argument arity requirement shared by the planner’s FIXED_ARITY_FUNCTIONS row and the executor’s list-builtin backstop — the bare detail, without the InvalidNumberOfArguments class token, which each layer composes exactly once (crate::Error::invalid_number_of_arguments, or the typed channel).
GRAPH_SELECTOR_FUNCTIONS
The composite-database graph.* selector function names, lowercased (ADR-0116 §3). One shared list: the planner’s use_target resolves these calls as USE selectors (with element-id resolution for graph.byElementId) and rejects them with CE’s 42N72 text in expression position, while the executor’s SHOW FUNCTIONS catalog lists them as catalog-only entries (discoverable but not executable). Two separate lists would drift.
GRAPH_SELECTOR_FUNCTION_NAMES
The selector names, derived from GRAPH_SELECTOR_FUNCTIONS — the one table — for consumers that need a flat &[&str] (the executor’s catalog-only SHOW FUNCTIONS entries).
LENGTH_REQUIRES_A_PATH
The one spelling of length()’s non-path argument rejection, shared by the planner’s static rules and the executor’s runtime backstop — the bare detail, without the InvalidArgumentType class token, which each layer composes (the FUNCTION_REQUIRES_ONE_ARGUMENT precedent).
MAX_TRAVERSAL_DEPTH
Hops an explicit traversal bound may ask for without opting in (--max-traversal-depth / RELATE_MAX_TRAVERSAL_DEPTH).
MAX_TRAVERSAL_DEPTH_CEILING
The largest --max-traversal-depth value an open accepts. Above this the recursive walker risks a stack overflow on small-stack platforms (WebAssembly’s 16 MiB stack is the tightest supported surface).
MAX_VALUE_DEPTH
The deepest container nesting a Value may have (ADR-0462, LABS-606).
MAX_WIRE_MESSAGE_BYTES
The byte bound of one wire message every surface frames around — the value Bolt’s chunked framing caps a message at and the C ABI’s params builder caps one put_string value at (single-sourced so the two surfaces can never disagree). Fixed constant, no knob (ADR-0514).
NEGATIVE_PAGE_BOUND_DETAIL
The one negative-SKIP/LIMIT detail, shared by the front end’s compile-time rule, the planner’s rule and the executor’s runtime guard: the layer that fires decides the class, never the wording.
NULLIF_ARITY
nullif()’s two-argument contract.
NULLIF_REQUIRES_TWO_ARGUMENTS
The one spelling of nullif()’s two-argument arity requirement: the front-end static-argument check and the executor’s implementation both state it from here, so the compile-time and runtime halves cannot drift (the FUNCTION_REQUIRES_ONE_ARGUMENT precedent).
PREVIEW_FEATURES
Every registered feature, registry order — the enumeration callers iterate instead of re-spelling the vocabulary.
VECTOR_ARITY
vector()’s three-argument contract.
VECTOR_REQUIRES_THREE_ARGUMENTS
The one spelling of vector()’s three-argument arity requirement, shared by the front-end check and the executor’s implementation.

Functions§

auto_literal
The literal a plan-cache placeholder stands for, when one is installed. Any other name, including a caller’s parameter, is None.
bare_type_name
value_type_name without the nullability suffix — the type spelling the 22N27/22NB1 dynamic-operand detail text renders (DATE, LIST<STRING | INTEGER>).
builtin_arity
The arity contract shared across the front-end check, the planner’s rule table and the executor’s dispatch, by lowercased builtin name. None for a name with no cross-layer contract (its arity, if any, is owned by one layer alone).
bytes_logical_bytes
A byte payload’s documented logical size (ADR-0042): the 16-byte header plus its bytes — the one spelling every payload-size site reads, beside str_logical_bytes and Value::logical_bytes.
column_type_name
One canonical ADR-0224 type name for an engine Value — the name spelling of [column_type_kind], for the engine’s QueryResult::column_types stamp.
cypher_to_value
duplicate_variable_detail
The one spelling of a duplicate-binding rejection’s detail (after the VariableAlreadyBound: kind token): variable '<name>' already declared.
dynamic_label_names
The one dynamic label/type rule: the operand must be a STRING or a LIST<STRING>, and every name must be non-empty and NUL-free.
dynamic_property_key
The one dynamic property-key rule: the key must be a non-empty, NUL-free STRING.
expected_type_detail
The one spelling of the wrong-type sentence the 22N01 argument errors and the SEARCH validators share. The expected set is the caller’s own signature; the actual type name is the caller’s vocabulary (crate::value_type_name, or a SEARCH source-kind display name).
expected_value_type_detail
The value-bearing form of crate::expected_type_detail (22N01): the offending value renders as its Cypher literal, except the null literal, which Neo4j spells NULL in this sentence, and the actual type is bare_type_name’s. The one spelling for a write’s bound node position and the read-side entity checks.
is_graph_selector_function_name
True for the composite-database graph.* selector names (case-insensitive). The one predicate home — callers never spell the membership test themselves. Allocation-free: compares with eq_ignore_ascii_case like Namespace::parse does.
is_unsafe_output_char
The single classification of characters that must never reach a human-facing output surface raw: Unicode general-category Cc controls (C0, DEL, C1, via char::is_control) and Cf format characters (bidi overrides such as U+202E RIGHT-TO-LEFT OVERRIDE, zero-width marks such as U+200B/U+200E, and U+FEFF), which is_control does not cover but which reorder or hide printable text and can spoof a terminal.
is_virtual_id
Whether id belongs to a CIP-257 virtual entity — a graph-type projection synthesized with a negative id and carried by its value alone (it has no store entry). Persisted ids are non-negative (validate_persisted_id), so the sign is the one virtual-entity test.
logical_bytes_within
Whether the summed logical bytes (ADR-0042, as Value::logical_bytes) of values stay within limit, or None once the running total exceeds it. The one early-stopping logical-bytes walk (ADR-0341): the total stops being computed as soon as it exceeds limit instead of walking every value.
negative_page_bound_text
NEGATIVE_PAGE_BOUND_DETAIL under its pinned NegativeIntegerArgument token — the one composition both stringly layers use: the planner wraps it in the compile-time Syntax class, the executor’s runtime guard in its Execution class.
next_depth
The next container level below depth, or None once that level would exceed MAX_VALUE_DEPTH. The canonical ADR-0462 guard for walkers that saturate or throw at the cap (renderers, JSON decoders/encoders, the model bridge, the logical-bytes walk); re-exported so the HTTP Query API encoder spells it the same way. depth is the number of containers enclosing the value, so a root is 0.
node_element_id
The element id string of a node in namespace (4:<segment>:n<id>), built through the same validated namespace the parser accepts — an ad-hoc segment could emit an id the engine’s own parser refuses.
parse_expression_memory_limit
Parse the expression-memory-limit grammar: parse_memory_limit plus the explicit opt-out spelling none (case-insensitive), which maps to 0 = no cap. 0 is already unlimited in parse_memory_limit.
parse_memory_limit
Parse --logical-graph-size-limit / RELATE_LOGICAL_GRAPH_SIZE_LIMIT sizes.
parse_node_element_id
The node id encoded in a relate element id, or None for a relationship id, a foreign namespace, or a malformed value.
parse_positive_memory_limit
parse_memory_limit for a size that must be greater than zero.
parse_rel_element_id
The relationship id encoded in a relate element id, or None.
point_component
One component accessor of a point (p.x, p.longitude, p.crs, …) — the one point-accessor vocabulary, the data-model sibling of the temporal accessor (crate::temporal::Temporal::component): a key no component names is the same typed rejection the temporal reader answers, never a silently null read. The coordinate aliases (x is longitude) are the shared axis vocabulary beside PointValue.
preview_feature_disabled_text
The authored fail-closed gate text for a preview feature invoked while disabled, already prefixed with its SemanticError class — the single source of the gate message. PreviewFeatures::require wraps it in an Error; layers outside this crate (the executor’s graph-type semantic layer, which fails closed on the same constructs its statement-admission gate already checked when they only materialize against stored graph-type state) render it through their own error type without re-spelling it.
rel_element_id
The element id string of a relationship in namespace (5:<segment>:r<id>).
require_positive_memory_limit
Reject 0 for a size that turns a feature on.
require_traversal_depth
Validate a caller-supplied traversal depth. name is the flag or variable the caller read it from, so the error is self-explaining.
str_logical_bytes
A string’s documented logical size (ADR-0042): the 16-byte header plus its UTF-8 bytes — the one spelling every string-size sum reads (row keys, node and relationship property keys), beside Value::logical_bytes.
tagged_str
The tagged string [TaggedRef] writes for Value::String.
traversal_depth_exceeded_message
The user-facing rejection for a query whose explicit hop bound asks for more than the admission limit. The wording states what the limit protects, that it is not a database limit, and how far it can be raised (ceiling, MAX_TRAVERSAL_DEPTH_CEILING).
undefined_variable_detail
The one spelling of an undefined-variable rejection’s detail (after the UndefinedVariable: kind token): variable '<name>' not defined. Both error channels — the typed relate_error::EngineError and the executor’s string-carrying crate::Error — render the same text.
uniqueness_violation_detail
The bare ConstraintValidationFailed detail of a uniqueness violation — Error::UniquenessViolation’s Display without the semantic error: prefix, for error composition that embeds the violation’s message.
unknown_function_detail
The one spelling of an unknown-function rejection’s detail (after the UnknownFunction: kind token): unknown function <name>(). The planner’s binder, the executor’s scalar-eval backstop and the front’s preview-name admission gate all render this text, so a gated name is rejected exactly like a name the registry has never known.
uuid_hyphenated
Render a 128-bit UUID value as the canonical lowercase hyphenated string (8-4-4-4-12, CIP-246 / RFC 4122).
uuid_parse
Parse an RFC-4122-shaped UUID string (case-insensitive, hyphens required, 8-4-4-4-12 groups) into its 128-bit value. None on any non-conforming input, mirroring Java’s UUID.fromString strictness (CIP-246).
validate_persisted_id
The single acceptance rule for a persisted local node or relationship ID.
value_depth_exceeded
The one ValueDepthExceeded detail payload (ADR-0462), beside MAX_VALUE_DEPTH. what names the value shape the walker rejected ("value", "tagged value", "coll.flatten() input"). Every raiser — Value::check_depth, the tagged decoder and encoder, the collection helpers — spells the message through here so the detail and the limit cannot drift.
value_to_cypher
value_type_name
The Cypher type name of value, including the NOT NULL suffix the valueType() surface renders.

Type Aliases§

NodeId
RelId
Result