MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / handle_insert

Method handle_insert

sdks/rust/src/client_cache.rs:248–259  ·  view source on GitHub ↗
(&mut self, inserts: &mut RowEventMap<'r, Row>, insert: &'r WithBsatn<Row>)

Source from the content-addressed store, hash-verified

246 }
247
248 fn handle_insert<'r>(&mut self, inserts: &mut RowEventMap<'r, Row>, insert: &'r WithBsatn<Row>) {
249 let entry = self.entries.entry(insert.bsatn.clone());
250 let entry = entry.or_insert_with(|| {
251 // First time inserting this row, so let's add an insertion event.
252 inserts.insert(&insert.bsatn, &insert.row);
253 RowEntry {
254 row: insert.row.clone(),
255 ref_count: 0,
256 }
257 });
258 entry.ref_count += 1;
259 }
260
261 /// Apply all the deletes and inserts recorded in `diff`.
262 /// Return a [`TableAppliedDiff`] which encodes the actual changes to rows present or deleted

Callers 1

apply_diffMethod · 0.80

Calls 3

entryMethod · 0.80
insertMethod · 0.65
cloneMethod · 0.45

Tested by

no test coverage detected