Skip to main content

Crate selene_core

Crate selene_core 

Source
Expand description

Foundation types for the selene-db ISO/IEC 39075:2024 GQL property graph engine.

This crate is the dependency root: every other selene crate transitively depends on it. Per D8, selene-core has zero dependencies on other selene crates. The mandatory data types of ISO GQL minimum conformance live here (STRING, BOOLEAN, INT, FLOAT); composite, temporal, and reference value types are also normatively defined in Spec 02 and implemented here. The crate now also carries the composite containers, schema model, origin metadata, and WAL change payload types needed by downstream crates.

See Spec 02 for the full data model specification.

Re-exports§

pub use cancellation::CancellationCause;
pub use cancellation::CancellationChecker;
pub use cancellation::CancellationToken;
pub use cancellation::NodeScanBudget;
pub use change_kind::ChangeKind;
pub use changeset::Change;
pub use changeset::LabelDiff;
pub use changeset::PropertyDiff;
pub use changeset::SchemaChange;
pub use changeset::SchemaPropertyIndexKind;
pub use changeset::SchemaVectorIndexKind;
pub use db_string::DbString;
pub use db_string::db_string;
pub use error::CoreError;
pub use error::CoreResult;
pub use extension_type_ids::ExtensionTypeId;
pub use extension_type_ids::FIRST_PARTY_EXTENSION_TYPE_IDS;
pub use extension_type_ids::SELENE_RDF;
pub use extension_type_ids::SELENE_TIMESERIES;
pub use gqlstatus::ALL_GQLSTATUS_NAMES;
pub use gqlstatus::gqlstatus_name;
pub use hlc::HlcTimestamp;
pub use identity::BindingTableId;
pub use identity::EdgeId;
pub use identity::GraphId;
pub use identity::NodeId;
pub use identity::RecordTypeId;
pub use label_set::LabelSet;
pub use origin::Origin;
pub use property_map::PropertyMap;
pub use property_map::PropertyMapIter;
pub use property_map::PropertyMapKeys;
pub use property_map::PropertyMapValues;
pub use property_value_type::PropertyValueType;
pub use reserved::RESERVED_LABEL_PREFIX;
pub use schema::EdgeEndpointDef;
pub use schema::EdgeTypeDef;
pub use schema::EdgeTypeDefV1;
pub use schema::GraphType;
pub use schema::GraphTypeId;
pub use schema::KeyLabelSetPolicy;
pub use schema::NodeKey;
pub use schema::NodeTypeDef;
pub use schema::NodeTypeDefV1;
pub use schema::NodeTypeRef;
pub use schema::PredefinedValueType;
pub use schema::PropertyDef;
pub use schema::PropertyDefV1;
pub use schema::RecordFieldStructure;
pub use schema::RecordFieldStructureDef;
pub use schema::RecordFieldStructureType;
pub use schema::RecordTypeDef;
pub use schema::RecordTypeRef;
pub use schema::ValidationMode;
pub use schema::ValueType;
pub use schema::ValueTypeCardinality;
pub use value::EdgeDirection;
pub use value::MAX_VECTOR_DIMENSION;
pub use value::Path;
pub use value::PathSegment;
pub use value::Record;
pub use value::RecordTyped;
pub use value::Value;
pub use value::VectorValue;
pub use vector::TURBO_QUANT_BLOCK_ROWS;
pub use vector::TurboQuantBitWidth;
pub use vector::TurboQuantBlockedCodes;
pub use vector::TurboQuantCodebook;
pub use vector::TurboQuantCodebookKind;
pub use vector::TurboQuantCodecError;
pub use vector::TurboQuantCodecResult;
pub use vector::TurboQuantPackedCodes;
pub use vector::VectorMetric;
pub use vector::VectorMetricQuery;
pub use vector::VectorSearchHit;
pub use vector::VectorTopK;
pub use vector::exact_vector_top_k;
pub use vector::vector_squared_norm;
pub use vector_index::HnswIndexConfig;
pub use vector_index::IvfIndexConfig;

Modules§

cancellation
Cooperative cancellation primitives shared by the executor and algorithm crates.
change_kind
Compact stable discriminants for Change variants.
changeset
WAL change payloads per spec 02 section 9.
db_string
Engine-owned database strings backed by shared string storage.
error
Core error types and ISO GQLSTATUS mappings.
extension_type_ids
Value-type ID reservations for Value::Extended payloads.
feature_register
ISO/IEC 39075:2024 feature and implementation-defined registers.
gqlstatus
GQLSTATUS codes emitted by selene-db plus symbolic names.
hlc
Hybrid logical clock timestamp per spec 04 section 3.2.
identity
Graph, catalog, and request identifier types per spec 02 section 4.
label_set
Sorted label sets per spec 02 section 5.3.
metrics
Optional metrics facade for embedders that install a metrics recorder.
origin
Mutation origin metadata per spec 02 section 8.
property_map
Property maps per spec 02 section 5.2.
property_value_type
Runtime property value type tags for closed graph validation.
reserved
Reserved label prefixes for engine-internal graph metadata.
schema
Schema model types per spec 02 section 6.
value
In-memory GQL value representation per spec 02 section 3.
vector
Native dense-vector metric kernels and exact-search helpers.
vector_index
Durable vector-index configuration payloads.

Structs§

ByteStringType
User-specified byte-string length metadata.
CharacterStringType
User-specified character-string length metadata.
DecimalType
User-specified decimal exact numeric type metadata.
JsonValue
Native JSON payload stored as a first-class crate::Value.
JsonValueRef
Borrowed JSON subvalue selected from a validated JsonValue.

Enums§

CharacterStringCoercionError
Failure modes from coerce_character_string_to_type.
DurationTypeQualifier
ISO temporal duration type qualifier.
DurationValueFamily
Field family carried by a concrete duration value.
JsonPathSelector
Selector used by JSON path-existence helpers.

Constants§

MAX_BYTE_STRING_TYPE_LENGTH
Maximum declared byte length for bounded byte-string types (BYTES(n) / BYTES(min, max) / BINARY(n) / VARBINARY(n)).
MAX_CHARACTER_STRING_TYPE_LENGTH
Maximum declared character length for bounded character-string types (STRING(n) / STRING(min, max) / CHAR(n) / VARCHAR(n)).
MAX_DECIMAL_PRECISION
Maximum decimal precision currently representable by selene-db’s rust_decimal-backed crate::Value::Decimal storage.
MAX_DECIMAL_SCALE
Maximum decimal scale currently representable by selene-db’s rust_decimal-backed crate::Value::Decimal storage.

Functions§

byte_string_fits_type
Return true when value can be represented by byte_string_type.
character_string_fits_type
Return true when value can be represented by character_string_type.
coerce_character_string_to_type
Coerce value into the target character-length envelope.
decimal_fits_type
Return true when value can be represented exactly by decimal_type.
duration_order_key
Return the canonical ordered key for a duration span.
duration_value_family
Return the duration field family, or None when year/month and day/time fields are mixed in one span.
is_truncating_whitespace
Return true when character may be silently discarded by length-bound truncation.
round_decimal_to_type
Round value to the target scale and return it if it fits the requested precision/scale envelope.

Type Aliases§

DurationOrderKey
Ordered key used for duration comparisons and duration-backed indexes.