pub struct CompactEdgeRecord {
pub neighbor_id: i64,
pub edge_type_offset: u16,
pub edge_data: Vec<u8>,
}Expand description
Compact edge record for V2 format.
The layout is deterministic:
[neighbor_id: i64][edge_type_offset: u16][edge_data_len: u16][edge_data: bytes...]
Fields§
§neighbor_id: i64Neighbor node ID (target for outgoing, source for incoming).
edge_type_offset: u16Edge type offset inside the shared string table.
edge_data: Vec<u8>Serialized JSON payload for the edge.
Implementations§
Source§impl CompactEdgeRecord
impl CompactEdgeRecord
Sourcepub fn new(neighbor_id: i64, edge_type_offset: u16, edge_data: Vec<u8>) -> Self
pub fn new(neighbor_id: i64, edge_type_offset: u16, edge_data: Vec<u8>) -> Self
Construct a new compact record from primitive fields.
Sourcepub fn deserialize(bytes: &[u8]) -> NativeResult<Self>
pub fn deserialize(bytes: &[u8]) -> NativeResult<Self>
Deserialize a compact record from the provided bytes.
Sourcepub fn size_bytes(&self) -> usize
pub fn size_bytes(&self) -> usize
Total serialized size of this record.
Sourcepub fn from_edge_record(
edge: &EdgeRecord,
direction: Direction,
string_table: &mut StringTable,
) -> NativeResult<Self>
pub fn from_edge_record( edge: &EdgeRecord, direction: Direction, string_table: &mut StringTable, ) -> NativeResult<Self>
Create compact record directly from EdgeRecord without data loss. This is the new pipeline method that preserves original edge_type and edge_data.
Trait Implementations§
Source§impl Clone for CompactEdgeRecord
impl Clone for CompactEdgeRecord
Source§fn clone(&self) -> CompactEdgeRecord
fn clone(&self) -> CompactEdgeRecord
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CompactEdgeRecord
impl RefUnwindSafe for CompactEdgeRecord
impl Send for CompactEdgeRecord
impl Sync for CompactEdgeRecord
impl Unpin for CompactEdgeRecord
impl UnwindSafe for CompactEdgeRecord
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)