Skip to main content

EngineConfig

Enum EngineConfig 

Source
#[non_exhaustive]
pub enum EngineConfig { CompactBfs, EulerTour, Hdt, ClusterForest, }
Expand description

The implementation chosen when creating a graph.

Selection is immutable for the lifetime of a ConnectivityGraph. No automatic switching or answer cache is introduced by this configuration.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

CompactBfs

Compact adjacency with a fresh BFS for each connectivity query.

§

EulerTour

Euler-tour forest with candidate-pruned replacement search: a stable interface for an experimental engine.

This is not HDT and does not provide polylogarithmic update bounds. The variant, its selector "ett" (EngineConfig::as_str) and the ForestGraph API stay compatible across 1.x, like EngineConfig::Hdt: they are removed or renamed only after a deprecation and in a major release, and #[non_exhaustive] on this enum does not authorize removing them. “Experimental” qualifies only the engine’s performance, maturity and usage recommendation (EngineConfig::is_experimental returns true).

§

Hdt

Deterministic HDT with level-based replacement search: a stable interface for an experimental engine.

The variant, its selector "hdt" (EngineConfig::as_str) and the HdtGraph API stay compatible across 1.x: they are removed or renamed only after a deprecation and in a major release, and #[non_exhaustive] on this enum does not authorize removing them. “Experimental” qualifies only the engine’s performance, maturity and usage recommendation (EngineConfig::is_experimental returns true): it carries no performance, latency or memory promise, lifecycle support is not available, and EngineConfig::CompactBfs remains the default.

§

ClusterForest

Cluster forest (Wulff-Nilsen, SODA 2013, §3, with the path compression of De Man et al., PVLDB 2025, §4): a stable interface for an experimental engine, new in 1.1.

The variant and its selector "cluster-forest" (EngineConfig::as_str) stay compatible across 1.x like EngineConfig::EulerTour and EngineConfig::Hdt: they are removed or renamed only after a deprecation and in a major release, and #[non_exhaustive] on this enum does not authorize removing them. “Experimental” qualifies only the engine’s performance, maturity and usage recommendation (EngineConfig::is_experimental returns true): it carries no performance, latency or memory promise, and EngineConfig::CompactBfs remains the default. The backend type itself is internal: use the engine through ConnectivityGraph or crate::LifecycleGraph, which supports it.

Updates are O(log² N) amortized by this project’s derivation for this variant (ADR 0014), not by a published theorem; queries walk to the roots in O(log N). It accepts at most 2²⁸ vertices and 2²⁸ edges and reports more as GraphError::NodeLimitExceeded or GraphError::EdgeLimitExceeded carrying that limit (or the configured GraphLimits value, when lower). Under crate::LifecycleGraph the enforced limits are 2²⁷ − 512 nodes and 2²⁸ edges, leaving room for retired slots. Through ConnectivityGraph the configured limits are checked first (node before edge), then the engine’s capacity: at that capacity a configured edge limit can therefore be reported before the engine’s node capacity.

Implementations§

Source§

impl EngineConfig

Source

pub fn as_str(self) -> &'static str

Returns the stable external selector for this engine.

Source

pub fn is_experimental(self) -> bool

Whether this engine is qualified as experimental: its performance, maturity and usage recommendation carry no promise, although its public interface may be stable.

Returns false for EngineConfig::CompactBfs and true for EngineConfig::EulerTour, EngineConfig::Hdt and EngineConfig::ClusterForest in this release. The value for the experimental engines may stay true for the whole 1.x series; it becomes false only when an engine is promoted, in a minor release that records it in the release notes, and it never changes from false to true for an existing engine. The value says nothing about the interface’s stability class: both variants are stable interfaces either way. The server reports the same value as the experimental field of GET /v1/info.

§Examples
use knotrel_core::EngineConfig;

assert!(!EngineConfig::CompactBfs.is_experimental());
assert!(EngineConfig::EulerTour.is_experimental());
assert!(EngineConfig::Hdt.is_experimental());
assert!(EngineConfig::ClusterForest.is_experimental());
assert_eq!(EngineConfig::Hdt.as_str(), "hdt");
assert_eq!(EngineConfig::ClusterForest.as_str(), "cluster-forest");

Trait Implementations§

Source§

impl Clone for EngineConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for EngineConfig

Source§

impl Debug for EngineConfig

Source§

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

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

impl Default for EngineConfig

Source§

fn default() -> Self

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

impl Eq for EngineConfig

Source§

impl PartialEq for EngineConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EngineConfig

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.