MCPcopy Create free account
hub / github.com/hashintel/hash / deserialize

Method deserialize

libs/@local/hashql/diagnostics/src/severity.rs:476–489  ·  view source on GitHub ↗
(deserializer: D)

Source from the content-addressed store, hash-verified

474#[cfg(feature = "serde")]
475impl<'de> serde::Deserialize<'de> for Severity {
476 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
477 where
478 D: serde::Deserializer<'de>,
479 {
480 let info = OwnedSeverityInfo::deserialize(deserializer)?;
481
482 for severity in Self::variants() {
483 if severity.code() == info.code {
484 return Ok(*severity);
485 }
486 }
487
488 Err(serde::de::Error::custom("invalid severity code"))
489 }
490}
491
492impl Display for Severity {

Callers

nothing calls this directly

Calls 5

OkInterface · 0.85
ErrInterface · 0.85
deserializeFunction · 0.70
codeMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected