Skip to main content

Engine

Struct Engine 

Source
pub struct Engine { /* private fields */ }
Expand description

Active [OxGraph] backend state loaded from OXGTOPO bytes.

Implementations§

Source§

impl Engine

Source

pub fn node_count(&self) -> u32

Returns the canonical node count from artifact metadata.

Source

pub fn from_snapshot_bytes(bytes: &[u8]) -> Result<Self, PostgresGraphError>

Loads an engine via EngineBuilder.

§Errors

Returns PostgresGraphError when snapshot validation or topology attach fails.

Source

pub fn status(&self) -> EngineStatus

Returns operational status for admin surfaces.

Source

pub const fn config(&self) -> &Config

Returns the active configuration mirror.

Source

pub fn set_config(&mut self, config: Config) -> Result<(), PostgresGraphError>

Updates configuration after validation.

§Errors

Returns PostgresGraphError::Config when limits or freshness settings are invalid.

Source

pub const fn overlay(&self) -> &OverlayState

Borrows overlay state for read-only query visibility checks.

Source

pub const fn overlay_mut(&mut self) -> &mut OverlayState

Borrows the overlay buffer for sync replay.

Source

pub fn snapshot_bytes(&self) -> &[u8]

Returns immutable snapshot bytes backing the engine.

Source

pub fn topology(&self) -> &GraphTopology<'_>

Returns both topology views opened at engine build.

Source

pub fn forward(&self) -> &ForwardCsr<'_>

Returns the forward CSR view (outgoing adjacency only).

Source

pub fn inbound(&self) -> &InboundCsc<'_>

Returns the inbound CSC view (incoming adjacency only).

Source

pub fn replace_snapshot_bytes( &mut self, bytes: &[u8], ) -> Result<(), PostgresGraphError>

Replaces artifact bytes after maintenance rebuild.

§Errors

Returns PostgresGraphError when the replacement snapshot fails validation.

Source

pub fn traverse( &mut self, seed: u32, limits: TraverseLimits, direction: TraversalDirection, ) -> Result<Vec<u32>, PostgresGraphError>

Breadth-first traversal from one seed node.

§Errors

Returns PostgresGraphError::Query when the seed is out of bounds or limits are zero.

§Performance

This method is O(r + e) where r is nodes discovered up to result_limit and e is edges examined along the chosen profile; ≤ 1ms for n ≤ 10k on typical chain fixtures.

Source

pub fn traverse_from_seeds( &mut self, seeds: &[u32], limits: TraverseLimits, direction: TraversalDirection, ) -> Result<Vec<u32>, PostgresGraphError>

Breadth-first traversal from multiple seed nodes in one kernel run.

§Errors

Returns PostgresGraphError::Query when every seed is out of bounds or limits are zero.

§Performance

Same as Self::traverse with multiple seeds; one kernel run.

Source

pub fn visited_count( &mut self, seed: u32, limits: TraverseLimits, direction: TraversalDirection, ) -> Result<usize, PostgresGraphError>

Returns visited-node count for one seed without collecting ids.

§Errors

Returns PostgresGraphError::Query when the seed is out of bounds or limits are zero.

§Performance

This method is O(r + e) without output allocation; matches collect cardinality.

Source

pub fn search( &self, predicate: SearchPredicate, limit: NonZeroUsize, ) -> Result<Vec<u32>, PostgresGraphError>

Searches dense node ids using a simple predicate.

§Errors

Returns PostgresGraphError::Query when the effective limit is zero.

§Performance

This method is O(n) for n canonical nodes until the effective limit is reached.

Source

pub fn apply_sync_rows( &mut self, rows: &[SyncRow], ) -> Result<usize, PostgresGraphError>

Applies sync rows to the overlay in sequence order.

§Errors

Returns PostgresGraphError::Sync when row sequence numbers are not monotonic.

Source

pub fn sync_health(&self) -> SyncHealth

Returns sync overlay health for admin surfaces.

Source

pub fn rebuild_from_catalog( &mut self, catalog: &Catalog, edges: &[EdgeRow], built_at_unix: u64, ) -> Result<(), PostgresGraphError>

Rebuilds the base artifact from catalog metadata and freshly scanned edge rows.

§Errors

Returns PostgresGraphError::Config when maintenance is disabled, or build/validation errors from catalog planning and snapshot encoding.

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> ErasedDestructor for T
where T: 'static,

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.