3 releases
0.1.2 | Dec 22, 2022 |
---|---|
0.1.1 | Oct 21, 2022 |
0.1.0 | Oct 21, 2022 |
#1355 in Encoding
3,810 downloads per month
Used in 3 crates
(2 directly)
13KB
270 lines
serde_serializer_quick_unsupported
Helper for implementing a serializer that supports a reduced subset of the serde data model
Often times you need to implement a serializer where a bunch of input types are unexpected/unsupported This convenience macro allows you to declare those more easily:
use serde_serializer_quick_unsupported::serializer_unsupported;
struct MySerializer;
impl serde::Serializer for MySerializer {
type Ok = ();
type Error = serde::de::value::Error;
serializer_unsupported! {
err = (<Self::Error as serde::ser::Error>::custom("Unexpected input"));
bool i8 i16 i32 i64 u8 u16 u32 u64 f32 f64 char str bytes none some unit unit_struct
unit_variant newtype_struct newtype_variant seq tuple tuple_struct tuple_variant map struct
struct_variant i128 u128
}
}
Just remove the stuff you want to not error