MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / append

Method append

nodedb/src/control/backup/state.rs:37–44  ·  view source on GitHub ↗

Returns Err once the cap would be exceeded.

(&mut self, chunk: &[u8])

Source from the content-addressed store, hash-verified

35
36 /// Returns Err once the cap would be exceeded.
37 pub fn append(&mut self, chunk: &[u8]) -> Result<(), u64> {
38 let new_total = self.bytes.len() as u64 + chunk.len() as u64;
39 if new_total > self.max_bytes {
40 return Err(self.max_bytes);
41 }
42 self.bytes.extend_from_slice(chunk);
43 Ok(())
44 }
45}
46
47/// Connection-keyed map of in-flight restores.

Callers 4

append_then_takeFunction · 0.45
append_respects_capFunction · 0.45
on_copy_dataMethod · 0.45
execute_sqlMethod · 0.45

Calls 4

lockMethod · 0.80
lenMethod · 0.45
expectMethod · 0.45
get_mutMethod · 0.45

Tested by 2

append_then_takeFunction · 0.36
append_respects_capFunction · 0.36