MCPcopy Create free account
hub / github.com/RetypeOS/parcode / to_bytes

Method to_bytes

src/format.rs:168–173  ·  view source on GitHub ↗

Serializes to a fixed-size byte array (Little Endian).

(&self)

Source from the content-addressed store, hash-verified

166
167 /// Serializes to a fixed-size byte array (Little Endian).
168 pub fn to_bytes(&self) -> [u8; Self::SIZE] {
169 let mut buf = [0u8; Self::SIZE];
170 buf[0..8].copy_from_slice(&self.offset.to_le_bytes());
171 buf[8..16].copy_from_slice(&self.length.to_le_bytes());
172 buf
173 }
174
175 /// Deserializes from a fixed-size byte array.
176 pub fn from_bytes(bytes: &[u8]) -> Result<Self> {

Callers 4

writeMethod · 0.80
write_syncMethod · 0.80
execute_graph_serialFunction · 0.80
process_nodeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected