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

Function encode_vertex_position

atomic-core/src/crdt/tables.rs:341–347  ·  view source on GitHub ↗
(node: &GraphNode<NodeId>)

Source from the content-addressed store, hash-verified

339/// ```
340#[inline]
341pub fn encode_vertex_position(node: &GraphNode<NodeId>) -> [u8; 24] {
342 let mut bytes = [0u8; 24];
343 bytes[0..8].copy_from_slice(&node.change.get().to_le_bytes());
344 bytes[8..16].copy_from_slice(&node.start.get().to_le_bytes());
345 bytes[16..24].copy_from_slice(&node.end.get().to_le_bytes());
346 bytes
347}
348
349/// Decode a Span from 24 bytes.
350#[inline]

Callers 5

apply_file_ops_batchedFunction · 0.85

Calls 2

to_le_bytesMethod · 0.80
getMethod · 0.65

Tested by 1