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

Method get_owned

nodedb-crdt/src/policy.rs:196–201  ·  view source on GitHub ↗

Retrieve the policy for a collection as an owned value. Returns the registered policy if found, otherwise returns the default (ephemeral).

(&self, collection: &str)

Source from the content-addressed store, hash-verified

194 /// Retrieve the policy for a collection as an owned value.
195 /// Returns the registered policy if found, otherwise returns the default (ephemeral).
196 pub fn get_owned(&self, collection: &str) -> CollectionPolicy {
197 self.policies
198 .get(collection)
199 .cloned()
200 .unwrap_or_else(CollectionPolicy::ephemeral)
201 }
202
203 /// Check if a collection has an explicit policy registered.
204 pub fn has(&self, collection: &str) -> bool {

Callers 3

set_for_kindMethod · 0.80
validate_with_policyMethod · 0.80
get_collection_policyMethod · 0.80

Calls 1

getMethod · 0.45

Tested by

no test coverage detected