pub struct V3EdgeCluster {
pub src: i64,
pub edges: Vec<CompactEdgeRecord>,
pub direction: Direction,
pub format_version: u8,
pub page_id: u64,
}Expand description
Edge cluster entry for V3 storage Uses V2 CompactEdgeRecord format for compatibility
Fields§
§src: i64Source node ID (logical, not slot)
edges: Vec<CompactEdgeRecord>Destination node IDs with edge data
direction: DirectionEdge direction
format_version: u8Format version for future migration
page_id: u64Page ID where this cluster is stored
Implementations§
Source§impl V3EdgeCluster
impl V3EdgeCluster
Sourcepub fn add_edge(&mut self, dst: i64, edge_type: Option<String>)
pub fn add_edge(&mut self, dst: i64, edge_type: Option<String>)
Add edge to cluster Edge type is encoded in edge_data using inline format: [type_len: u8][type_bytes]
Sourcepub fn edges_with_types(&self) -> Vec<(i64, Option<String>)>
pub fn edges_with_types(&self) -> Vec<(i64, Option<String>)>
Get edges with their types (for recovery/rebuilding HashMap)
Sourcepub fn serialize(&self) -> NativeResult<Vec<u8>>
pub fn serialize(&self) -> NativeResult<Vec<u8>>
Serialize to bytes for page storage Format v3: [version: 1 byte] [src: 8 bytes] [dir: 1 byte] [compressed: 1 byte] [edge_count: 4 bytes] [compressed_ids…][edge_metadata…] Format v2: [version: 1 byte] [src: 8 bytes] [dir: 1 byte] [edge_count: 4 bytes] [edges…] Format v1: [version: 1 byte] [edge_count: 4 bytes] [edges…] (legacy, no src/dir)
Sourcepub fn deserialize(bytes: &[u8], page_id: u64) -> NativeResult<Self>
pub fn deserialize(bytes: &[u8], page_id: u64) -> NativeResult<Self>
Deserialize from bytes Format v2: [version: 1 byte] [src: 8 bytes] [dir: 1 byte] [edge_count: 4 bytes] [edges…] Format v1: [version: 1 byte] [edge_count: 4 bytes] [edges…] (src=0, dir=Outgoing)
Trait Implementations§
Source§impl Clone for V3EdgeCluster
impl Clone for V3EdgeCluster
Source§fn clone(&self) -> V3EdgeCluster
fn clone(&self) -> V3EdgeCluster
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for V3EdgeCluster
impl RefUnwindSafe for V3EdgeCluster
impl Send for V3EdgeCluster
impl Sync for V3EdgeCluster
impl Unpin for V3EdgeCluster
impl UnsafeUnpin for V3EdgeCluster
impl UnwindSafe for V3EdgeCluster
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
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>
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>
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