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

Method encode

atomic-core/src/pristine/file_index_v2.rs:72–78  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

70 }
71
72 pub fn encode(&self) -> Vec<u8> {
73 let mut bytes = Vec::with_capacity(KEY_HEADER_SIZE + self.path.len());
74 bytes.push(FILE_INDEX_V2_KEY_VERSION);
75 bytes.extend_from_slice(self.working_copy.as_bytes());
76 bytes.extend_from_slice(&self.path);
77 bytes
78 }
79
80 pub fn decode(bytes: &[u8]) -> PristineResult<Self> {
81 if bytes.len() <= KEY_HEADER_SIZE {

Callers

nothing calls this directly

Calls 3

lenMethod · 0.45
pushMethod · 0.45
as_bytesMethod · 0.45

Tested by

no test coverage detected