Skip to main content

SnapshotGraphBuilder

Struct SnapshotGraphBuilder 

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

Builds an InMemoryGraph from snapshot records one at a time.

A decoder that streams a snapshot pushes each record as it decodes it, so the records are never all held at once beside the graph they fill. Push every node before the relationships that reference it, then call Self::finish with the catalogs, which registers the indexes and constraints over the loaded data.

Implementations§

Source§

impl SnapshotGraphBuilder

Source

pub fn new( next_node_id: NodeId, next_rel_id: RelationshipId, ) -> Result<Self, SnapshotError>

Source

pub fn push_node(&mut self, node: NodeRecord) -> Result<(), SnapshotError>

Source

pub fn push_relationship( &mut self, rel: RelationshipRecord, ) -> Result<(), SnapshotError>

Source

pub fn finish( self, indexes: Vec<IndexDefinition>, constraints: Vec<ConstraintDefinition>, vector_indexes: Vec<VectorIndexSnapshot>, ) -> Result<InMemoryGraph, SnapshotError>

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> 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 = !

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.