diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /third_party/rust/ron/src/de/id.rs | |
parent | Initial commit. (diff) | |
download | firefox-esr-upstream.tar.xz firefox-esr-upstream.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'third_party/rust/ron/src/de/id.rs')
-rw-r--r-- | third_party/rust/ron/src/de/id.rs | 246 |
1 files changed, 246 insertions, 0 deletions
diff --git a/third_party/rust/ron/src/de/id.rs b/third_party/rust/ron/src/de/id.rs new file mode 100644 index 0000000000..537ce5690a --- /dev/null +++ b/third_party/rust/ron/src/de/id.rs @@ -0,0 +1,246 @@ +use serde::de::{self, Visitor}; + +use super::{Deserializer, Error, Result}; + +pub struct IdDeserializer<'a, 'b: 'a> { + d: &'a mut Deserializer<'b>, +} + +impl<'a, 'b: 'a> IdDeserializer<'a, 'b> { + pub fn new(d: &'a mut Deserializer<'b>) -> Self { + IdDeserializer { d } + } +} + +impl<'a, 'b: 'a, 'c> de::Deserializer<'b> for &'c mut IdDeserializer<'a, 'b> { + type Error = Error; + + fn deserialize_identifier<V>(self, visitor: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + self.d.deserialize_identifier(visitor) + } + + fn deserialize_str<V>(self, visitor: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + self.deserialize_identifier(visitor) + } + + fn deserialize_any<V>(self, visitor: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + self.deserialize_identifier(visitor) + } + + fn deserialize_bool<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_i8<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_i16<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_i32<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_i64<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + #[cfg(feature = "integer128")] + fn deserialize_i128<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_u8<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_u16<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_u32<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_u64<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + #[cfg(feature = "integer128")] + fn deserialize_u128<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_f32<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_f64<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_char<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_string<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_bytes<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_byte_buf<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_option<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_unit<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_unit_struct<V>(self, _: &'static str, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_newtype_struct<V>(self, _: &'static str, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_seq<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_tuple<V>(self, _: usize, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_tuple_struct<V>(self, _: &'static str, _: usize, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_map<V>(self, _: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_struct<V>( + self, + _: &'static str, + _: &'static [&'static str], + _: V, + ) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_enum<V>( + self, + _: &'static str, + _: &'static [&'static str], + _: V, + ) -> Result<V::Value> + where + V: Visitor<'b>, + { + unimplemented!("IdDeserializer may only be used for identifiers") + } + + fn deserialize_ignored_any<V>(self, visitor: V) -> Result<V::Value> + where + V: Visitor<'b>, + { + self.deserialize_any(visitor) + } +} |