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

Function deserialize_edge

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

Source from the content-addressed store, hash-verified

53/// Deserialize bytes to a SerializedGraphEdge
54#[inline]
55pub fn deserialize_edge(bytes: &[u8; 24]) -> SerializedGraphEdge {
56 let flag_and_pos = u64::from_le_bytes(bytes[0..8].try_into().unwrap());
57 let change_id = u64::from_le_bytes(bytes[8..16].try_into().unwrap());
58 let introduced_by = u64::from_le_bytes(bytes[16..24].try_into().unwrap());
59
60 let flag = EdgeFlags::from_bits_truncate((flag_and_pos >> 56) as u8);
61 let pos = flag_and_pos & ((1 << 56) - 1);
62
63 let dest = Position::new(NodeId::new(change_id), ChangePosition::new(pos));
64 SerializedGraphEdge::new(flag, dest, NodeId::new(introduced_by))
65}
66
67// View State Serialization
68

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