pub struct SnapshotEncoder { /* private fields */ }Expand description
Encodes snapshot records into a graph’s stored form on any thread,
for the SnapshotGraphBuilder that primed
it. Cheap to clone.
Implementations§
Source§impl SnapshotEncoder
impl SnapshotEncoder
Sourcepub fn node_batch(&self, capacity: usize) -> NodeBatch
pub fn node_batch(&self, capacity: usize) -> NodeBatch
A batch for about capacity records.
Sourcepub fn relationship_batch(&self, capacity: usize) -> RelationshipBatch
pub fn relationship_batch(&self, capacity: usize) -> RelationshipBatch
A batch for about capacity records. capacity comes from the
snapshot being read, so at most a frame’s worth is reserved up front.
Sourcepub fn push_node(
&self,
batch: &mut NodeBatch,
id: NodeId,
labels: &[u32],
properties: &mut Vec<(u32, PropertyValue)>,
) -> Result<(), SnapshotError>
pub fn push_node( &self, batch: &mut NodeBatch, id: NodeId, labels: &[u32], properties: &mut Vec<(u32, PropertyValue)>, ) -> Result<(), SnapshotError>
Encode a node: labels and the keys of properties are numbers in
the snapshot’s SnapshotNames. Takes the values out of
properties, leaving it empty for the next record.
Sourcepub fn push_relationship(
&self,
batch: &mut RelationshipBatch,
id: RelationshipId,
src: NodeId,
dst: NodeId,
rel_type: u32,
properties: &mut Vec<(u32, PropertyValue)>,
) -> Result<(), SnapshotError>
pub fn push_relationship( &self, batch: &mut RelationshipBatch, id: RelationshipId, src: NodeId, dst: NodeId, rel_type: u32, properties: &mut Vec<(u32, PropertyValue)>, ) -> Result<(), SnapshotError>
Encode a relationship: rel_type and the keys of properties are
numbers in the snapshot’s SnapshotNames.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SnapshotEncoder
impl RefUnwindSafe for SnapshotEncoder
impl Send for SnapshotEncoder
impl Sync for SnapshotEncoder
impl Unpin for SnapshotEncoder
impl UnsafeUnpin for SnapshotEncoder
impl UnwindSafe for SnapshotEncoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more