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

Method remove

nodedb/src/control/sequence/registry.rs:80–90  ·  view source on GitHub ↗

Remove a sequence. Returns error if not found.

(&self, tenant_id: u64, name: &str)

Source from the content-addressed store, hash-verified

78
79 /// Remove a sequence. Returns error if not found.
80 pub fn remove(&self, tenant_id: u64, name: &str) -> Result<(), SequenceError> {
81 let key = registry_key(tenant_id, name);
82 let mut map = self.sequences.write().unwrap_or_else(|p| p.into_inner());
83
84 if map.remove(&key).is_none() {
85 return Err(SequenceError::NotFound {
86 name: name.to_string(),
87 });
88 }
89 Ok(())
90 }
91
92 /// Get the next value from a sequence (lock-free on the hot path).
93 pub fn nextval(&self, tenant_id: u64, name: &str) -> Result<i64, SequenceError> {

Callers 15

drop_roleMethod · 0.45
remove_quotaMethod · 0.45
stop_impersonationMethod · 0.45
revoke_delegationMethod · 0.45
unregisterMethod · 0.45
resetMethod · 0.45
record_ipMethod · 0.45
drop_policyMethod · 0.45
unregisterMethod · 0.45
remove_entryMethod · 0.45

Calls 3

registry_keyFunction · 0.85
to_stringMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected