MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / unique_violation

Method unique_violation

crates/openshell-server/src/persistence/mod.rs:55–65  ·  view source on GitHub ↗
(constraint: Option<String>, detail: Option<String>)

Source from the content-addressed store, hash-verified

53
54impl PersistenceError {
55 pub fn unique_violation(constraint: Option<String>, detail: Option<String>) -> Self {
56 let constraint_msg = constraint
57 .as_ref()
58 .map(|value| format!(" on {value}"))
59 .unwrap_or_default();
60 Self::UniqueViolation {
61 constraint,
62 detail,
63 constraint_msg,
64 }
65 }
66
67 pub fn is_unique_violation_on(&self, constraint: &str) -> bool {
68 matches!(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected