Created
April 19, 2019 10:37
-
-
Save lawliet89/23ee158224fd688747b429f6ab3775de to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![feature(prelude_import)] | |
#![no_std] | |
#[prelude_import] | |
use std::prelude::v1::*; | |
#[macro_use] | |
extern crate std as std; | |
use serde::{Deserialize, Serialize}; | |
pub struct Test { | |
pub foo: String, | |
pub bar: bool, | |
} | |
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] | |
const _IMPL_SERIALIZE_FOR_Test: () = { | |
#[allow(unknown_lints)] | |
#[allow(rust_2018_idioms)] | |
extern crate serde as _serde; | |
#[automatically_derived] | |
impl _serde::Serialize for Test { | |
fn serialize<__S>(&self, __serializer: __S) -> _serde::export::Result<__S::Ok, __S::Error> | |
where | |
__S: _serde::Serializer, | |
{ | |
let mut __serde_state = match _serde::Serializer::serialize_struct( | |
__serializer, | |
"Test", | |
false as usize + 1 + 1, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
match _serde::ser::SerializeStruct::serialize_field( | |
&mut __serde_state, | |
"foo", | |
&self.foo, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
match _serde::ser::SerializeStruct::serialize_field( | |
&mut __serde_state, | |
"bar", | |
&self.bar, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
_serde::ser::SerializeStruct::end(__serde_state) | |
} | |
} | |
}; | |
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] | |
const _IMPL_DESERIALIZE_FOR_Test: () = { | |
#[allow(unknown_lints)] | |
#[allow(rust_2018_idioms)] | |
extern crate serde as _serde; | |
#[automatically_derived] | |
impl<'de> _serde::Deserialize<'de> for Test { | |
fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result<Self, __D::Error> | |
where | |
__D: _serde::Deserializer<'de>, | |
{ | |
#[allow(non_camel_case_types)] | |
enum __Field { | |
__field0, | |
__field1, | |
__ignore, | |
} | |
struct __FieldVisitor; | |
impl<'de> _serde::de::Visitor<'de> for __FieldVisitor { | |
type Value = __Field; | |
fn expecting( | |
&self, | |
__formatter: &mut _serde::export::Formatter, | |
) -> _serde::export::fmt::Result { | |
_serde::export::Formatter::write_str(__formatter, "field identifier") | |
} | |
fn visit_u64<__E>(self, __value: u64) -> _serde::export::Result<Self::Value, __E> | |
where | |
__E: _serde::de::Error, | |
{ | |
match __value { | |
0u64 => _serde::export::Ok(__Field::__field0), | |
1u64 => _serde::export::Ok(__Field::__field1), | |
_ => _serde::export::Err(_serde::de::Error::invalid_value( | |
_serde::de::Unexpected::Unsigned(__value), | |
&"field index 0 <= i < 2", | |
)), | |
} | |
} | |
fn visit_str<__E>(self, __value: &str) -> _serde::export::Result<Self::Value, __E> | |
where | |
__E: _serde::de::Error, | |
{ | |
match __value { | |
"foo" => _serde::export::Ok(__Field::__field0), | |
"bar" => _serde::export::Ok(__Field::__field1), | |
_ => _serde::export::Ok(__Field::__ignore), | |
} | |
} | |
fn visit_bytes<__E>( | |
self, | |
__value: &[u8], | |
) -> _serde::export::Result<Self::Value, __E> | |
where | |
__E: _serde::de::Error, | |
{ | |
match __value { | |
b"foo" => _serde::export::Ok(__Field::__field0), | |
b"bar" => _serde::export::Ok(__Field::__field1), | |
_ => _serde::export::Ok(__Field::__ignore), | |
} | |
} | |
} | |
impl<'de> _serde::Deserialize<'de> for __Field { | |
#[inline] | |
fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result<Self, __D::Error> | |
where | |
__D: _serde::Deserializer<'de>, | |
{ | |
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) | |
} | |
} | |
struct __Visitor<'de> { | |
marker: _serde::export::PhantomData<Test>, | |
lifetime: _serde::export::PhantomData<&'de ()>, | |
} | |
impl<'de> _serde::de::Visitor<'de> for __Visitor<'de> { | |
type Value = Test; | |
fn expecting( | |
&self, | |
__formatter: &mut _serde::export::Formatter, | |
) -> _serde::export::fmt::Result { | |
_serde::export::Formatter::write_str(__formatter, "struct Test") | |
} | |
#[inline] | |
fn visit_seq<__A>( | |
self, | |
mut __seq: __A, | |
) -> _serde::export::Result<Self::Value, __A::Error> | |
where | |
__A: _serde::de::SeqAccess<'de>, | |
{ | |
let __field0 = | |
match match _serde::de::SeqAccess::next_element::<String>(&mut __seq) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} { | |
_serde::export::Some(__value) => __value, | |
_serde::export::None => { | |
return _serde::export::Err(_serde::de::Error::invalid_length( | |
0usize, | |
&"struct Test with 2 elements", | |
)); | |
} | |
}; | |
let __field1 = | |
match match _serde::de::SeqAccess::next_element::<bool>(&mut __seq) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} { | |
_serde::export::Some(__value) => __value, | |
_serde::export::None => { | |
return _serde::export::Err(_serde::de::Error::invalid_length( | |
1usize, | |
&"struct Test with 2 elements", | |
)); | |
} | |
}; | |
_serde::export::Ok(Test { | |
foo: __field0, | |
bar: __field1, | |
}) | |
} | |
#[inline] | |
fn visit_map<__A>( | |
self, | |
mut __map: __A, | |
) -> _serde::export::Result<Self::Value, __A::Error> | |
where | |
__A: _serde::de::MapAccess<'de>, | |
{ | |
let mut __field0: _serde::export::Option<String> = _serde::export::None; | |
let mut __field1: _serde::export::Option<bool> = _serde::export::None; | |
while let _serde::export::Some(__key) = | |
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} | |
{ | |
match __key { | |
__Field::__field0 => { | |
if _serde::export::Option::is_some(&__field0) { | |
return _serde::export::Err( | |
<__A::Error as _serde::de::Error>::duplicate_field("foo"), | |
); | |
} | |
__field0 = _serde::export::Some( | |
match _serde::de::MapAccess::next_value::<String>(&mut __map) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}, | |
); | |
} | |
__Field::__field1 => { | |
if _serde::export::Option::is_some(&__field1) { | |
return _serde::export::Err( | |
<__A::Error as _serde::de::Error>::duplicate_field("bar"), | |
); | |
} | |
__field1 = _serde::export::Some( | |
match _serde::de::MapAccess::next_value::<bool>(&mut __map) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}, | |
); | |
} | |
_ => { | |
let _ = match _serde::de::MapAccess::next_value::< | |
_serde::de::IgnoredAny, | |
>(&mut __map) | |
{ | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
} | |
} | |
} | |
let __field0 = match __field0 { | |
_serde::export::Some(__field0) => __field0, | |
_serde::export::None => match _serde::private::de::missing_field("foo") { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}, | |
}; | |
let __field1 = match __field1 { | |
_serde::export::Some(__field1) => __field1, | |
_serde::export::None => match _serde::private::de::missing_field("bar") { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}, | |
}; | |
_serde::export::Ok(Test { | |
foo: __field0, | |
bar: __field1, | |
}) | |
} | |
} | |
const FIELDS: &'static [&'static str] = &["foo", "bar"]; | |
_serde::Deserializer::deserialize_struct( | |
__deserializer, | |
"Test", | |
FIELDS, | |
__Visitor { | |
marker: _serde::export::PhantomData::<Test>, | |
lifetime: _serde::export::PhantomData, | |
}, | |
) | |
} | |
} | |
}; | |
#[serde(untagged)] | |
pub enum Untagged { | |
Request { | |
id: String, | |
method: String, | |
params: Params, | |
}, | |
Response { | |
id: String, | |
result: Value, | |
}, | |
} | |
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] | |
const _IMPL_SERIALIZE_FOR_Untagged: () = { | |
#[allow(unknown_lints)] | |
#[allow(rust_2018_idioms)] | |
extern crate serde as _serde; | |
#[automatically_derived] | |
impl _serde::Serialize for Untagged { | |
fn serialize<__S>(&self, __serializer: __S) -> _serde::export::Result<__S::Ok, __S::Error> | |
where | |
__S: _serde::Serializer, | |
{ | |
match *self { | |
Untagged::Request { | |
ref id, | |
ref method, | |
ref params, | |
} => { | |
let mut __serde_state = match _serde::Serializer::serialize_struct( | |
__serializer, | |
"Untagged", | |
0 + 1 + 1 + 1, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
match _serde::ser::SerializeStruct::serialize_field( | |
&mut __serde_state, | |
"id", | |
id, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
match _serde::ser::SerializeStruct::serialize_field( | |
&mut __serde_state, | |
"method", | |
method, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
match _serde::ser::SerializeStruct::serialize_field( | |
&mut __serde_state, | |
"params", | |
params, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
_serde::ser::SerializeStruct::end(__serde_state) | |
} | |
Untagged::Response { ref id, ref result } => { | |
let mut __serde_state = match _serde::Serializer::serialize_struct( | |
__serializer, | |
"Untagged", | |
0 + 1 + 1, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
match _serde::ser::SerializeStruct::serialize_field( | |
&mut __serde_state, | |
"id", | |
id, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
match _serde::ser::SerializeStruct::serialize_field( | |
&mut __serde_state, | |
"result", | |
result, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
_serde::ser::SerializeStruct::end(__serde_state) | |
} | |
} | |
} | |
} | |
}; | |
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] | |
const _IMPL_DESERIALIZE_FOR_Untagged: () = { | |
#[allow(unknown_lints)] | |
#[allow(rust_2018_idioms)] | |
extern crate serde as _serde; | |
#[automatically_derived] | |
impl<'de> _serde::Deserialize<'de> for Untagged { | |
fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result<Self, __D::Error> | |
where | |
__D: _serde::Deserializer<'de>, | |
{ | |
let __content = match <_serde::private::de::Content as _serde::Deserialize>::deserialize( | |
__deserializer, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
if let _serde::export::Ok(__ok) = { | |
#[allow(non_camel_case_types)] | |
enum __Field { | |
__field0, | |
__field1, | |
__field2, | |
__ignore, | |
} | |
struct __FieldVisitor; | |
impl<'de> _serde::de::Visitor<'de> for __FieldVisitor { | |
type Value = __Field; | |
fn expecting( | |
&self, | |
__formatter: &mut _serde::export::Formatter, | |
) -> _serde::export::fmt::Result { | |
_serde::export::Formatter::write_str(__formatter, "field identifier") | |
} | |
fn visit_u64<__E>( | |
self, | |
__value: u64, | |
) -> _serde::export::Result<Self::Value, __E> | |
where | |
__E: _serde::de::Error, | |
{ | |
match __value { | |
0u64 => _serde::export::Ok(__Field::__field0), | |
1u64 => _serde::export::Ok(__Field::__field1), | |
2u64 => _serde::export::Ok(__Field::__field2), | |
_ => _serde::export::Err(_serde::de::Error::invalid_value( | |
_serde::de::Unexpected::Unsigned(__value), | |
&"field index 0 <= i < 3", | |
)), | |
} | |
} | |
fn visit_str<__E>( | |
self, | |
__value: &str, | |
) -> _serde::export::Result<Self::Value, __E> | |
where | |
__E: _serde::de::Error, | |
{ | |
match __value { | |
"id" => _serde::export::Ok(__Field::__field0), | |
"method" => _serde::export::Ok(__Field::__field1), | |
"params" => _serde::export::Ok(__Field::__field2), | |
_ => _serde::export::Ok(__Field::__ignore), | |
} | |
} | |
fn visit_bytes<__E>( | |
self, | |
__value: &[u8], | |
) -> _serde::export::Result<Self::Value, __E> | |
where | |
__E: _serde::de::Error, | |
{ | |
match __value { | |
b"id" => _serde::export::Ok(__Field::__field0), | |
b"method" => _serde::export::Ok(__Field::__field1), | |
b"params" => _serde::export::Ok(__Field::__field2), | |
_ => _serde::export::Ok(__Field::__ignore), | |
} | |
} | |
} | |
impl<'de> _serde::Deserialize<'de> for __Field { | |
#[inline] | |
fn deserialize<__D>( | |
__deserializer: __D, | |
) -> _serde::export::Result<Self, __D::Error> | |
where | |
__D: _serde::Deserializer<'de>, | |
{ | |
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) | |
} | |
} | |
struct __Visitor<'de> { | |
marker: _serde::export::PhantomData<Untagged>, | |
lifetime: _serde::export::PhantomData<&'de ()>, | |
} | |
impl<'de> _serde::de::Visitor<'de> for __Visitor<'de> { | |
type Value = Untagged; | |
fn expecting( | |
&self, | |
__formatter: &mut _serde::export::Formatter, | |
) -> _serde::export::fmt::Result { | |
_serde::export::Formatter::write_str( | |
__formatter, | |
"struct variant Untagged::Request", | |
) | |
} | |
#[inline] | |
fn visit_map<__A>( | |
self, | |
mut __map: __A, | |
) -> _serde::export::Result<Self::Value, __A::Error> | |
where | |
__A: _serde::de::MapAccess<'de>, | |
{ | |
let mut __field0: _serde::export::Option<String> = _serde::export::None; | |
let mut __field1: _serde::export::Option<String> = _serde::export::None; | |
let mut __field2: _serde::export::Option<Params> = _serde::export::None; | |
while let _serde::export::Some(__key) = | |
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} | |
{ | |
match __key { | |
__Field::__field0 => { | |
if _serde::export::Option::is_some(&__field0) { | |
return _serde::export::Err( | |
<__A::Error as _serde::de::Error>::duplicate_field( | |
"id", | |
), | |
); | |
} | |
__field0 = _serde::export::Some( | |
match _serde::de::MapAccess::next_value::<String>( | |
&mut __map, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}, | |
); | |
} | |
__Field::__field1 => { | |
if _serde::export::Option::is_some(&__field1) { | |
return _serde::export::Err( | |
<__A::Error as _serde::de::Error>::duplicate_field( | |
"method", | |
), | |
); | |
} | |
__field1 = _serde::export::Some( | |
match _serde::de::MapAccess::next_value::<String>( | |
&mut __map, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}, | |
); | |
} | |
__Field::__field2 => { | |
if _serde::export::Option::is_some(&__field2) { | |
return _serde::export::Err( | |
<__A::Error as _serde::de::Error>::duplicate_field( | |
"params", | |
), | |
); | |
} | |
__field2 = _serde::export::Some( | |
match _serde::de::MapAccess::next_value::<Params>( | |
&mut __map, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}, | |
); | |
} | |
_ => { | |
let _ = match _serde::de::MapAccess::next_value::< | |
_serde::de::IgnoredAny, | |
>(&mut __map) | |
{ | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
} | |
} | |
} | |
let __field0 = match __field0 { | |
_serde::export::Some(__field0) => __field0, | |
_serde::export::None => { | |
match _serde::private::de::missing_field("id") { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} | |
} | |
}; | |
let __field1 = match __field1 { | |
_serde::export::Some(__field1) => __field1, | |
_serde::export::None => { | |
match _serde::private::de::missing_field("method") { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} | |
} | |
}; | |
let __field2 = match __field2 { | |
_serde::export::Some(__field2) => __field2, | |
_serde::export::None => { | |
match _serde::private::de::missing_field("params") { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} | |
} | |
}; | |
_serde::export::Ok(Untagged::Request { | |
id: __field0, | |
method: __field1, | |
params: __field2, | |
}) | |
} | |
} | |
const FIELDS: &'static [&'static str] = &["id", "method", "params"]; | |
_serde::Deserializer::deserialize_any( | |
_serde::private::de::ContentRefDeserializer::<__D::Error>::new(&__content), | |
__Visitor { | |
marker: _serde::export::PhantomData::<Untagged>, | |
lifetime: _serde::export::PhantomData, | |
}, | |
) | |
} { | |
return _serde::export::Ok(__ok); | |
} | |
if let _serde::export::Ok(__ok) = { | |
#[allow(non_camel_case_types)] | |
enum __Field { | |
__field0, | |
__field1, | |
__ignore, | |
} | |
struct __FieldVisitor; | |
impl<'de> _serde::de::Visitor<'de> for __FieldVisitor { | |
type Value = __Field; | |
fn expecting( | |
&self, | |
__formatter: &mut _serde::export::Formatter, | |
) -> _serde::export::fmt::Result { | |
_serde::export::Formatter::write_str(__formatter, "field identifier") | |
} | |
fn visit_u64<__E>( | |
self, | |
__value: u64, | |
) -> _serde::export::Result<Self::Value, __E> | |
where | |
__E: _serde::de::Error, | |
{ | |
match __value { | |
0u64 => _serde::export::Ok(__Field::__field0), | |
1u64 => _serde::export::Ok(__Field::__field1), | |
_ => _serde::export::Err(_serde::de::Error::invalid_value( | |
_serde::de::Unexpected::Unsigned(__value), | |
&"field index 0 <= i < 2", | |
)), | |
} | |
} | |
fn visit_str<__E>( | |
self, | |
__value: &str, | |
) -> _serde::export::Result<Self::Value, __E> | |
where | |
__E: _serde::de::Error, | |
{ | |
match __value { | |
"id" => _serde::export::Ok(__Field::__field0), | |
"result" => _serde::export::Ok(__Field::__field1), | |
_ => _serde::export::Ok(__Field::__ignore), | |
} | |
} | |
fn visit_bytes<__E>( | |
self, | |
__value: &[u8], | |
) -> _serde::export::Result<Self::Value, __E> | |
where | |
__E: _serde::de::Error, | |
{ | |
match __value { | |
b"id" => _serde::export::Ok(__Field::__field0), | |
b"result" => _serde::export::Ok(__Field::__field1), | |
_ => _serde::export::Ok(__Field::__ignore), | |
} | |
} | |
} | |
impl<'de> _serde::Deserialize<'de> for __Field { | |
#[inline] | |
fn deserialize<__D>( | |
__deserializer: __D, | |
) -> _serde::export::Result<Self, __D::Error> | |
where | |
__D: _serde::Deserializer<'de>, | |
{ | |
_serde::Deserializer::deserialize_identifier(__deserializer, __FieldVisitor) | |
} | |
} | |
struct __Visitor<'de> { | |
marker: _serde::export::PhantomData<Untagged>, | |
lifetime: _serde::export::PhantomData<&'de ()>, | |
} | |
impl<'de> _serde::de::Visitor<'de> for __Visitor<'de> { | |
type Value = Untagged; | |
fn expecting( | |
&self, | |
__formatter: &mut _serde::export::Formatter, | |
) -> _serde::export::fmt::Result { | |
_serde::export::Formatter::write_str( | |
__formatter, | |
"struct variant Untagged::Response", | |
) | |
} | |
#[inline] | |
fn visit_map<__A>( | |
self, | |
mut __map: __A, | |
) -> _serde::export::Result<Self::Value, __A::Error> | |
where | |
__A: _serde::de::MapAccess<'de>, | |
{ | |
let mut __field0: _serde::export::Option<String> = _serde::export::None; | |
let mut __field1: _serde::export::Option<Value> = _serde::export::None; | |
while let _serde::export::Some(__key) = | |
match _serde::de::MapAccess::next_key::<__Field>(&mut __map) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} | |
{ | |
match __key { | |
__Field::__field0 => { | |
if _serde::export::Option::is_some(&__field0) { | |
return _serde::export::Err( | |
<__A::Error as _serde::de::Error>::duplicate_field( | |
"id", | |
), | |
); | |
} | |
__field0 = _serde::export::Some( | |
match _serde::de::MapAccess::next_value::<String>( | |
&mut __map, | |
) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}, | |
); | |
} | |
__Field::__field1 => { | |
if _serde::export::Option::is_some(&__field1) { | |
return _serde::export::Err( | |
<__A::Error as _serde::de::Error>::duplicate_field( | |
"result", | |
), | |
); | |
} | |
__field1 = _serde::export::Some( | |
match _serde::de::MapAccess::next_value::<Value>(&mut __map) | |
{ | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}, | |
); | |
} | |
_ => { | |
let _ = match _serde::de::MapAccess::next_value::< | |
_serde::de::IgnoredAny, | |
>(&mut __map) | |
{ | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
} | |
} | |
} | |
let __field0 = match __field0 { | |
_serde::export::Some(__field0) => __field0, | |
_serde::export::None => { | |
match _serde::private::de::missing_field("id") { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} | |
} | |
}; | |
let __field1 = match __field1 { | |
_serde::export::Some(__field1) => __field1, | |
_serde::export::None => { | |
match _serde::private::de::missing_field("result") { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} | |
} | |
}; | |
_serde::export::Ok(Untagged::Response { | |
id: __field0, | |
result: __field1, | |
}) | |
} | |
} | |
const FIELDS: &'static [&'static str] = &["id", "result"]; | |
_serde::Deserializer::deserialize_any( | |
_serde::private::de::ContentRefDeserializer::<__D::Error>::new(&__content), | |
__Visitor { | |
marker: _serde::export::PhantomData::<Untagged>, | |
lifetime: _serde::export::PhantomData, | |
}, | |
) | |
} { | |
return _serde::export::Ok(__ok); | |
} | |
_serde::export::Err(_serde::de::Error::custom( | |
"data did not match any variant of untagged enum Untagged", | |
)) | |
} | |
} | |
}; | |
pub struct Params(usize); | |
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] | |
const _IMPL_SERIALIZE_FOR_Params: () = { | |
#[allow(unknown_lints)] | |
#[allow(rust_2018_idioms)] | |
extern crate serde as _serde; | |
#[automatically_derived] | |
impl _serde::Serialize for Params { | |
fn serialize<__S>(&self, __serializer: __S) -> _serde::export::Result<__S::Ok, __S::Error> | |
where | |
__S: _serde::Serializer, | |
{ | |
_serde::Serializer::serialize_newtype_struct(__serializer, "Params", &self.0) | |
} | |
} | |
}; | |
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] | |
const _IMPL_DESERIALIZE_FOR_Params: () = { | |
#[allow(unknown_lints)] | |
#[allow(rust_2018_idioms)] | |
extern crate serde as _serde; | |
#[automatically_derived] | |
impl<'de> _serde::Deserialize<'de> for Params { | |
fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result<Self, __D::Error> | |
where | |
__D: _serde::Deserializer<'de>, | |
{ | |
struct __Visitor<'de> { | |
marker: _serde::export::PhantomData<Params>, | |
lifetime: _serde::export::PhantomData<&'de ()>, | |
} | |
impl<'de> _serde::de::Visitor<'de> for __Visitor<'de> { | |
type Value = Params; | |
fn expecting( | |
&self, | |
__formatter: &mut _serde::export::Formatter, | |
) -> _serde::export::fmt::Result { | |
_serde::export::Formatter::write_str(__formatter, "tuple struct Params") | |
} | |
#[inline] | |
fn visit_newtype_struct<__E>( | |
self, | |
__e: __E, | |
) -> _serde::export::Result<Self::Value, __E::Error> | |
where | |
__E: _serde::Deserializer<'de>, | |
{ | |
let __field0: usize = match <usize as _serde::Deserialize>::deserialize(__e) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
_serde::export::Ok(Params(__field0)) | |
} | |
#[inline] | |
fn visit_seq<__A>( | |
self, | |
mut __seq: __A, | |
) -> _serde::export::Result<Self::Value, __A::Error> | |
where | |
__A: _serde::de::SeqAccess<'de>, | |
{ | |
let __field0 = | |
match match _serde::de::SeqAccess::next_element::<usize>(&mut __seq) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} { | |
_serde::export::Some(__value) => __value, | |
_serde::export::None => { | |
return _serde::export::Err(_serde::de::Error::invalid_length( | |
0usize, | |
&"tuple struct Params with 1 element", | |
)); | |
} | |
}; | |
_serde::export::Ok(Params(__field0)) | |
} | |
} | |
_serde::Deserializer::deserialize_newtype_struct( | |
__deserializer, | |
"Params", | |
__Visitor { | |
marker: _serde::export::PhantomData::<Params>, | |
lifetime: _serde::export::PhantomData, | |
}, | |
) | |
} | |
} | |
}; | |
pub struct Value(bool); | |
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] | |
const _IMPL_SERIALIZE_FOR_Value: () = { | |
#[allow(unknown_lints)] | |
#[allow(rust_2018_idioms)] | |
extern crate serde as _serde; | |
#[automatically_derived] | |
impl _serde::Serialize for Value { | |
fn serialize<__S>(&self, __serializer: __S) -> _serde::export::Result<__S::Ok, __S::Error> | |
where | |
__S: _serde::Serializer, | |
{ | |
_serde::Serializer::serialize_newtype_struct(__serializer, "Value", &self.0) | |
} | |
} | |
}; | |
#[allow(non_upper_case_globals, unused_attributes, unused_qualifications)] | |
const _IMPL_DESERIALIZE_FOR_Value: () = { | |
#[allow(unknown_lints)] | |
#[allow(rust_2018_idioms)] | |
extern crate serde as _serde; | |
#[automatically_derived] | |
impl<'de> _serde::Deserialize<'de> for Value { | |
fn deserialize<__D>(__deserializer: __D) -> _serde::export::Result<Self, __D::Error> | |
where | |
__D: _serde::Deserializer<'de>, | |
{ | |
struct __Visitor<'de> { | |
marker: _serde::export::PhantomData<Value>, | |
lifetime: _serde::export::PhantomData<&'de ()>, | |
} | |
impl<'de> _serde::de::Visitor<'de> for __Visitor<'de> { | |
type Value = Value; | |
fn expecting( | |
&self, | |
__formatter: &mut _serde::export::Formatter, | |
) -> _serde::export::fmt::Result { | |
_serde::export::Formatter::write_str(__formatter, "tuple struct Value") | |
} | |
#[inline] | |
fn visit_newtype_struct<__E>( | |
self, | |
__e: __E, | |
) -> _serde::export::Result<Self::Value, __E::Error> | |
where | |
__E: _serde::Deserializer<'de>, | |
{ | |
let __field0: bool = match <bool as _serde::Deserialize>::deserialize(__e) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
}; | |
_serde::export::Ok(Value(__field0)) | |
} | |
#[inline] | |
fn visit_seq<__A>( | |
self, | |
mut __seq: __A, | |
) -> _serde::export::Result<Self::Value, __A::Error> | |
where | |
__A: _serde::de::SeqAccess<'de>, | |
{ | |
let __field0 = | |
match match _serde::de::SeqAccess::next_element::<bool>(&mut __seq) { | |
_serde::export::Ok(__val) => __val, | |
_serde::export::Err(__err) => { | |
return _serde::export::Err(__err); | |
} | |
} { | |
_serde::export::Some(__value) => __value, | |
_serde::export::None => { | |
return _serde::export::Err(_serde::de::Error::invalid_length( | |
0usize, | |
&"tuple struct Value with 1 element", | |
)); | |
} | |
}; | |
_serde::export::Ok(Value(__field0)) | |
} | |
} | |
_serde::Deserializer::deserialize_newtype_struct( | |
__deserializer, | |
"Value", | |
__Visitor { | |
marker: _serde::export::PhantomData::<Value>, | |
lifetime: _serde::export::PhantomData, | |
}, | |
) | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment