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

Function encode_vertex

atomic-core/src/pristine/tables.rs:1075–1081  ·  view source on GitHub ↗
(change_id: u64, start: u64, end: u64)

Source from the content-addressed store, hash-verified

1073/// Encode a span as 24 bytes for use as a graph key
1074#[inline]
1075pub fn encode_vertex(change_id: u64, start: u64, end: u64) -> [u8; 24] {
1076 let mut key = [0u8; 24];
1077 key[0..8].copy_from_slice(&change_id.to_be_bytes());
1078 key[8..16].copy_from_slice(&start.to_be_bytes());
1079 key[16..24].copy_from_slice(&end.to_be_bytes());
1080 key
1081}
1082
1083/// Decode a span from 24 bytes
1084#[inline]

Callers 15

vertex_keyFunction · 0.85
iter_adjacentMethod · 0.85
find_blockMethod · 0.85
find_block_endMethod · 0.85
has_vertexMethod · 0.85
has_change_in_graphMethod · 0.85
ensure_span_indexMethod · 0.85
iter_adjacentMethod · 0.85
find_blockMethod · 0.85

Calls

no outgoing calls