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

Method for_kind

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

Retrieve the policy for a given constraint kind.

(&self, kind: &crate::constraint::ConstraintKind)

Source from the content-addressed store, hash-verified

137
138 /// Retrieve the policy for a given constraint kind.
139 pub fn for_kind(&self, kind: &crate::constraint::ConstraintKind) -> &ConflictPolicy {
140 match kind {
141 crate::constraint::ConstraintKind::Unique => &self.unique,
142 crate::constraint::ConstraintKind::ForeignKey { .. }
143 | crate::constraint::ConstraintKind::BiTemporalFK { .. } => &self.foreign_key,
144 crate::constraint::ConstraintKind::NotNull => &self.not_null,
145 crate::constraint::ConstraintKind::Check { .. } => &self.check,
146 }
147 }
148}
149
150/// Registry of conflict resolution policies, keyed by collection name.

Callers 2

for_kind_lookupFunction · 0.45
validate_with_policyMethod · 0.45

Calls

no outgoing calls

Tested by 1

for_kind_lookupFunction · 0.36