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

Function remove_by_id

nodedb-crdt/src/dead_letter.rs:358–373  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

356
357 #[test]
358 fn remove_by_id() {
359 let mut dlq = DeadLetterQueue::new(10);
360 let c = test_constraint();
361 let hint = CompensationHint::ManualIntervention {
362 reason: "test".into(),
363 };
364
365 let id1 = dlq
366 .enqueue(1, 0, 0, vec![], &c, "a".into(), hint.clone())
367 .unwrap();
368 let _id2 = dlq.enqueue(1, 0, 0, vec![], &c, "b".into(), hint).unwrap();
369
370 let removed = dlq.remove(id1).unwrap();
371 assert_eq!(removed.reason, "a");
372 assert_eq!(dlq.len(), 1);
373 }
374}

Callers

nothing calls this directly

Calls 4

test_constraintFunction · 0.85
enqueueMethod · 0.45
cloneMethod · 0.45
removeMethod · 0.45

Tested by

no test coverage detected