pub enum CoherenceVerdict {
Coherent,
Mismatch {
field: MismatchField,
severity: MismatchSeverity,
},
Unknown(String),
}Expand description
Outcome of a single coherence evaluation.
Constructed by CoherencePort::evaluate. The Mismatch variant
carries enough information for the caller to map the verdict to a
CoherencePolicy decision (Advisory → log + proceed;
Hard + policy.hard_fail_on(field) → return error).
Variants§
Coherent
Every checked vector agreed (or no vectors were available).
Mismatch
A specific vector disagreed.
Fields
field: MismatchFieldWhich vector disagreed.
severity: MismatchSeverityHow serious the disagreement is.
Unknown(String)
Verdict could not be reached (missing data, disabled feature, etc.).
The String reason is intended for structured logs and test
assertions, never user-facing copy. Use
CoherenceVerdict::unknown to build a verdict from a
&'static str reason without spelling out the String
constructor at every call site.
Implementations§
Source§impl CoherenceVerdict
impl CoherenceVerdict
Sourcepub fn unknown(reason: &'static str) -> Self
pub fn unknown(reason: &'static str) -> Self
Convenience constructor for CoherenceVerdict::Unknown from a
static reason. Keeps the hot-path call site concise while still
allowing external callers to wrap an arbitrary string.
§Example
use stygian_proxy::ports::coherence::CoherenceVerdict;
let v = CoherenceVerdict::unknown("missing_dns");
assert!(v.is_unknown());
assert_eq!(v.unknown_reason(), Some("missing_dns"));Sourcepub const fn unknown_reason(&self) -> Option<&str>
pub const fn unknown_reason(&self) -> Option<&str>
Returns the Unknown reason as a string slice,
or None for Coherent / Mismatch.
Sourcepub const fn is_coherent(&self) -> bool
pub const fn is_coherent(&self) -> bool
Returns true when the verdict is CoherenceVerdict::Coherent.
Sourcepub const fn is_unknown(&self) -> bool
pub const fn is_unknown(&self) -> bool
Returns true when the verdict is CoherenceVerdict::Unknown.
Trait Implementations§
Source§impl Clone for CoherenceVerdict
impl Clone for CoherenceVerdict
Source§fn clone(&self) -> CoherenceVerdict
fn clone(&self) -> CoherenceVerdict
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CoherenceVerdict
impl Debug for CoherenceVerdict
Source§impl<'de> Deserialize<'de> for CoherenceVerdict
impl<'de> Deserialize<'de> for CoherenceVerdict
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for CoherenceVerdict
impl Display for CoherenceVerdict
impl Eq for CoherenceVerdict
Source§impl PartialEq for CoherenceVerdict
impl PartialEq for CoherenceVerdict
Source§impl Serialize for CoherenceVerdict
impl Serialize for CoherenceVerdict
impl StructuralPartialEq for CoherenceVerdict
Auto Trait Implementations§
impl Freeze for CoherenceVerdict
impl RefUnwindSafe for CoherenceVerdict
impl Send for CoherenceVerdict
impl Sync for CoherenceVerdict
impl Unpin for CoherenceVerdict
impl UnsafeUnpin for CoherenceVerdict
impl UnwindSafe for CoherenceVerdict
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.