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

Method from_bytes

atomic-core/src/crdt/ids.rs:99–106  ·  view source on GitHub ↗
(bytes: &[u8; 12])

Source from the content-addressed store, hash-verified

97 /// Decodes from 12 bytes.
98 #[inline]
99 pub fn from_bytes(bytes: &[u8; 12]) -> Self {
100 let change_id = NodeId::new(u64::from_le_bytes(bytes[0..8].try_into().unwrap()));
101 let file_idx = u32::from_le_bytes(bytes[8..12].try_into().unwrap());
102 TrunkId {
103 change_id,
104 file_idx,
105 }
106 }
107}
108
109impl fmt::Debug for TrunkId {

Callers

nothing calls this directly

Calls 1

unwrapMethod · 0.45

Tested by

no test coverage detected