Crates.io | serde_serializer_quick_unsupported |
lib.rs | serde_serializer_quick_unsupported |
version | 0.1.2 |
source | src |
created_at | 2022-10-21 09:45:51.312768 |
updated_at | 2022-12-22 22:38:07.91412 |
description | Helper for implementing a serializer that supports a reduced subset of the serde data model |
homepage | |
repository | https://github.com/Ten0/vec_storage_reuse |
max_upload_size | |
id | 693376 |
size | 20,157 |
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