MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / deserialize

Method deserialize

crates/commitlog/src/varchar.rs:98–106  ·  view source on GitHub ↗
(deserializer: D)

Source from the content-addressed store, hash-verified

96#[cfg(feature = "serde")]
97impl<'de, const N: usize> serde::Deserialize<'de> for Varchar<N> {
98 fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
99 where
100 D: serde::Deserializer<'de>,
101 {
102 let s = String::deserialize(deserializer)?;
103 let len = s.len();
104 Self::from_string(s)
105 .ok_or_else(|| serde::de::Error::custom(format!("input string too long: {len} max-len={N}")))
106 }
107}
108
109#[cfg(test)]

Callers

nothing calls this directly

Calls 4

from_stringFunction · 0.85
customFunction · 0.85
deserializeFunction · 0.50
lenMethod · 0.45

Tested by

no test coverage detected