Retrieve the policy for a given constraint kind.
(&self, kind: &crate::constraint::ConstraintKind)
| 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. |
no outgoing calls