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

Method handle_array_delete

nodedb/src/data/executor/dispatch/array/mutate.rs:43–71  ·  view source on GitHub ↗
(
        &mut self,
        task: &ExecutionTask,
        array_id: &ArrayId,
        coords_msgpack: &[u8],
        wal_lsn: u64,
    )

Source from the content-addressed store, hash-verified

41 }
42
43 pub(in crate::data::executor) fn handle_array_delete(
44 &mut self,
45 task: &ExecutionTask,
46 array_id: &ArrayId,
47 coords_msgpack: &[u8],
48 wal_lsn: u64,
49 ) -> Response {
50 let cells: Vec<ArrayDeleteCell> = match zerompk::from_msgpack(coords_msgpack) {
51 Ok(c) => c,
52 Err(e) => {
53 return self.response_error(
54 task,
55 ErrorCode::Internal {
56 detail: format!("array delete decode: {e}"),
57 },
58 );
59 }
60 };
61 let n = cells.len();
62 if let Err(e) = self.array_engine.delete_cells(array_id, cells, wal_lsn) {
63 return self.response_error(
64 task,
65 ErrorCode::Internal {
66 detail: format!("array delete: {e}"),
67 },
68 );
69 }
70 encode_count_response(self, task, "deleted", n)
71 }
72
73 pub(in crate::data::executor) fn handle_array_flush(
74 &mut self,

Callers 1

dispatch_arrayMethod · 0.80

Calls 4

encode_count_responseFunction · 0.85
response_errorMethod · 0.80
delete_cellsMethod · 0.80
lenMethod · 0.45

Tested by

no test coverage detected