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

Function decode_vertex_position

atomic-core/src/crdt/tables.rs:351–356  ·  view source on GitHub ↗
(bytes: &[u8; 24])

Source from the content-addressed store, hash-verified

349/// Decode a Span from 24 bytes.
350#[inline]
351pub fn decode_vertex_position(bytes: &[u8; 24]) -> GraphNode<NodeId> {
352 let change = NodeId::new(u64::from_le_bytes(bytes[0..8].try_into().unwrap()));
353 let start = ChangePosition::new(u64::from_le_bytes(bytes[8..16].try_into().unwrap()));
354 let end = ChangePosition::new(u64::from_le_bytes(bytes[16..24].try_into().unwrap()));
355 GraphNode { change, start, end }
356}
357
358// State Encoding/Decoding (1 byte each)
359

Callers 3

Calls 1

unwrapMethod · 0.45

Tested by 1