MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / deserialize_edge

Function deserialize_edge

atomic-core/src/pristine/txn/helpers.rs:36–46  ·  view source on GitHub ↗
(bytes: &[u8; 24])

Source from the content-addressed store, hash-verified

34/// Deserialize bytes to a SerializedGraphEdge
35#[inline]
36pub fn deserialize_edge(bytes: &[u8; 24]) -> SerializedGraphEdge {
37 let flag_and_pos = u64::from_le_bytes(bytes[0..8].try_into().unwrap());
38 let change_id = u64::from_le_bytes(bytes[8..16].try_into().unwrap());
39 let introduced_by = u64::from_le_bytes(bytes[16..24].try_into().unwrap());
40
41 let flag = EdgeFlags::from_bits_truncate((flag_and_pos >> 56) as u8);
42 let pos = flag_and_pos & ((1 << 56) - 1);
43
44 let dest = Position::new(NodeId::new(change_id), ChangePosition::new(pos));
45 SerializedGraphEdge::new(flag, dest, NodeId::new(introduced_by))
46}
47
48// View State Serialization
49

Callers 9

iter_adjacentMethod · 0.70
iter_inode_verticesMethod · 0.70
init_inode_adjMethod · 0.70
from_tableMethod · 0.70
test_edge_all_flagsFunction · 0.70
test_edge_max_positionFunction · 0.70
iter_adjacentMethod · 0.50
iter_inode_verticesMethod · 0.50

Calls 1

unwrapMethod · 0.45

Tested by 3

test_edge_all_flagsFunction · 0.56
test_edge_max_positionFunction · 0.56