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

Function decode_leaf_value

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

Source from the content-addressed store, hash-verified

644/// Decode leaf data from 22 bytes.
645#[inline]
646pub fn decode_leaf_value(bytes: &[u8; 22]) -> SerializedLeaf {
647 let branch_id = decode_branch_id(bytes[0..12].try_into().unwrap());
648 let kind = decode_token_kind(bytes[12]);
649 let state = decode_leaf_state(bytes[13]);
650 let content_start = u32::from_le_bytes(bytes[14..18].try_into().unwrap());
651 let content_end = u32::from_le_bytes(bytes[18..22].try_into().unwrap());
652 SerializedLeaf {
653 branch_id,
654 kind,
655 state,
656 content_start,
657 content_end,
658 }
659}
660
661// Trunk Value Encoding/Decoding (Variable Length)
662

Calls 4

decode_branch_idFunction · 0.85
decode_token_kindFunction · 0.85
decode_leaf_stateFunction · 0.85
unwrapMethod · 0.45