mirror of
https://github.com/pezkuwichain/serde.git
synced 2026-06-12 22:31:02 +00:00
Remove usize and isize from data model
This commit is contained in:
@@ -180,12 +180,10 @@ macro_rules! impl_deserialize_num {
|
||||
formatter.write_str(stringify!($ty))
|
||||
}
|
||||
|
||||
impl_deserialize_num_method!($ty, isize, visit_isize, from_isize, Signed, i64);
|
||||
impl_deserialize_num_method!($ty, i8, visit_i8, from_i8, Signed, i64);
|
||||
impl_deserialize_num_method!($ty, i16, visit_i16, from_i16, Signed, i64);
|
||||
impl_deserialize_num_method!($ty, i32, visit_i32, from_i32, Signed, i64);
|
||||
impl_deserialize_num_method!($ty, i64, visit_i64, from_i64, Signed, i64);
|
||||
impl_deserialize_num_method!($ty, usize, visit_usize, from_usize, Unsigned, u64);
|
||||
impl_deserialize_num_method!($ty, u8, visit_u8, from_u8, Unsigned, u64);
|
||||
impl_deserialize_num_method!($ty, u16, visit_u16, from_u16, Unsigned, u64);
|
||||
impl_deserialize_num_method!($ty, u32, visit_u32, from_u32, Unsigned, u64);
|
||||
@@ -209,12 +207,12 @@ macro_rules! impl_deserialize_num {
|
||||
}
|
||||
}
|
||||
|
||||
impl_deserialize_num!(isize, deserialize_isize);
|
||||
impl_deserialize_num!(isize, deserialize_i64);
|
||||
impl_deserialize_num!(i8, deserialize_i8);
|
||||
impl_deserialize_num!(i16, deserialize_i16);
|
||||
impl_deserialize_num!(i32, deserialize_i32);
|
||||
impl_deserialize_num!(i64, deserialize_i64);
|
||||
impl_deserialize_num!(usize, deserialize_usize);
|
||||
impl_deserialize_num!(usize, deserialize_u64);
|
||||
impl_deserialize_num!(u8, deserialize_u8);
|
||||
impl_deserialize_num!(u16, deserialize_u16);
|
||||
impl_deserialize_num!(u32, deserialize_u32);
|
||||
@@ -1150,7 +1148,7 @@ impl<T, E> Deserialize for Result<T, E> where T: Deserialize, E: Deserialize {
|
||||
formatter.write_str("`Ok` or `Err`")
|
||||
}
|
||||
|
||||
fn visit_usize<E>(self, value: usize) -> Result<Field, E> where E: Error {
|
||||
fn visit_u32<E>(self, value: u32) -> Result<Field, E> where E: Error {
|
||||
match value {
|
||||
0 => Ok(Field::Ok),
|
||||
1 => Ok(Field::Err),
|
||||
|
||||
+9
-31
@@ -339,12 +339,12 @@ pub enum Unexpected<'a> {
|
||||
/// The input contained a boolean value that was not expected.
|
||||
Bool(bool),
|
||||
|
||||
/// The input contained an unsigned integer `usize`, `u8`, `u16`, `u32` or
|
||||
/// `u64` that was not expected.
|
||||
/// The input contained an unsigned integer `u8`, `u16`, `u32` or `u64` that
|
||||
/// was not expected.
|
||||
Unsigned(u64),
|
||||
|
||||
/// The input contained a signed integer `isize`, `i8`, `i16`, `i32` or
|
||||
/// `i64` that was not expected.
|
||||
/// The input contained a signed integer `i8`, `i16`, `i32` or `i64` that
|
||||
/// was not expected.
|
||||
Signed(i64),
|
||||
|
||||
/// The input contained a floating point `f32` or `f64` that was not
|
||||
@@ -694,7 +694,7 @@ impl<T> DeserializeSeed for PhantomData<T>
|
||||
/// any data structure supported by Serde.
|
||||
///
|
||||
/// The role of this trait is to define the deserialization half of the Serde
|
||||
/// data model, which is a way to categorize every Rust data type into one of 30
|
||||
/// data model, which is a way to categorize every Rust data type into one of 28
|
||||
/// possible types. Each method of the `Serializer` trait corresponds to one of
|
||||
/// the types of the data model.
|
||||
///
|
||||
@@ -704,13 +704,13 @@ impl<T> DeserializeSeed for PhantomData<T>
|
||||
///
|
||||
/// The types that make up the Serde data model are:
|
||||
///
|
||||
/// - 15 primitive types:
|
||||
/// - 12 primitive types:
|
||||
/// - bool
|
||||
/// - isize, i8, i16, i32, i64
|
||||
/// - usize, u8, u16, u32, u64
|
||||
/// - i8, i16, i32, i64
|
||||
/// - u8, u16, u32, u64
|
||||
/// - f32, f64
|
||||
/// - char
|
||||
/// - string
|
||||
/// - string
|
||||
/// - byte array - [u8]
|
||||
/// - option
|
||||
/// - either none or some value
|
||||
@@ -792,10 +792,6 @@ pub trait Deserializer: Sized {
|
||||
fn deserialize_bool<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||
where V: Visitor;
|
||||
|
||||
/// Hint that the `Deserialize` type is expecting a `usize` value.
|
||||
fn deserialize_usize<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||
where V: Visitor;
|
||||
|
||||
/// Hint that the `Deserialize` type is expecting a `u8` value.
|
||||
fn deserialize_u8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||
where V: Visitor;
|
||||
@@ -812,10 +808,6 @@ pub trait Deserializer: Sized {
|
||||
fn deserialize_u64<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||
where V: Visitor;
|
||||
|
||||
/// Hint that the `Deserialize` type is expecting an `isize` value.
|
||||
fn deserialize_isize<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||
where V: Visitor;
|
||||
|
||||
/// Hint that the `Deserialize` type is expecting an `i8` value.
|
||||
fn deserialize_i8<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||
where V: Visitor;
|
||||
@@ -1030,13 +1022,6 @@ pub trait Visitor: Sized {
|
||||
Err(Error::invalid_type(Unexpected::Bool(v), &self))
|
||||
}
|
||||
|
||||
/// Deserialize an `isize` into a `Value`.
|
||||
fn visit_isize<E>(self, v: isize) -> Result<Self::Value, E>
|
||||
where E: Error,
|
||||
{
|
||||
self.visit_i64(v as i64)
|
||||
}
|
||||
|
||||
/// Deserialize an `i8` into a `Value`.
|
||||
fn visit_i8<E>(self, v: i8) -> Result<Self::Value, E>
|
||||
where E: Error,
|
||||
@@ -1065,13 +1050,6 @@ pub trait Visitor: Sized {
|
||||
Err(Error::invalid_type(Unexpected::Signed(v), &self))
|
||||
}
|
||||
|
||||
/// Deserialize a `usize` into a `Value`.
|
||||
fn visit_usize<E>(self, v: usize) -> Result<Self::Value, E>
|
||||
where E: Error,
|
||||
{
|
||||
self.visit_u64(v as u64)
|
||||
}
|
||||
|
||||
/// Deserialize a `u8` into a `Value`.
|
||||
fn visit_u8<E>(self, v: u8) -> Result<Self::Value, E>
|
||||
where E: Error,
|
||||
|
||||
@@ -28,10 +28,9 @@ pub fn missing_field<V, E>(field: &'static str) -> Result<V, E>
|
||||
}
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str
|
||||
string unit seq seq_fixed_size bytes byte_buf map unit_struct
|
||||
newtype_struct tuple_struct struct struct_field tuple enum
|
||||
ignored_any
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq
|
||||
seq_fixed_size bytes byte_buf map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple enum ignored_any
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+40
-41
@@ -126,9 +126,9 @@ impl<E> de::Deserializer for UnitDeserializer<E>
|
||||
type Error = E;
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit seq seq_fixed_size bytes map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple enum ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit seq
|
||||
seq_fixed_size bytes map unit_struct newtype_struct tuple_struct struct
|
||||
struct_field tuple enum ignored_any byte_buf
|
||||
}
|
||||
|
||||
fn deserialize<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||
@@ -147,7 +147,7 @@ impl<E> de::Deserializer for UnitDeserializer<E>
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
macro_rules! primitive_deserializer {
|
||||
($ty:ty, $name:ident, $method:ident) => {
|
||||
($ty:ty, $name:ident, $method:ident $($cast:tt)*) => {
|
||||
/// A helper deserializer that deserializes a number.
|
||||
pub struct $name<E>($ty, PhantomData<E>);
|
||||
|
||||
@@ -167,16 +167,15 @@ macro_rules! primitive_deserializer {
|
||||
type Error = E;
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str
|
||||
string unit option seq seq_fixed_size bytes map unit_struct
|
||||
newtype_struct tuple_struct struct struct_field tuple enum
|
||||
ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit
|
||||
option seq seq_fixed_size bytes map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple enum ignored_any byte_buf
|
||||
}
|
||||
|
||||
fn deserialize<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||
where V: de::Visitor,
|
||||
{
|
||||
visitor.$method(self.0)
|
||||
visitor.$method(self.0 $($cast)*)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -187,12 +186,12 @@ primitive_deserializer!(i8, I8Deserializer, visit_i8);
|
||||
primitive_deserializer!(i16, I16Deserializer, visit_i16);
|
||||
primitive_deserializer!(i32, I32Deserializer, visit_i32);
|
||||
primitive_deserializer!(i64, I64Deserializer, visit_i64);
|
||||
primitive_deserializer!(isize, IsizeDeserializer, visit_isize);
|
||||
primitive_deserializer!(isize, IsizeDeserializer, visit_i64 as i64);
|
||||
primitive_deserializer!(u8, U8Deserializer, visit_u8);
|
||||
primitive_deserializer!(u16, U16Deserializer, visit_u16);
|
||||
primitive_deserializer!(u32, U32Deserializer, visit_u32);
|
||||
primitive_deserializer!(u64, U64Deserializer, visit_u64);
|
||||
primitive_deserializer!(usize, UsizeDeserializer, visit_usize);
|
||||
primitive_deserializer!(usize, UsizeDeserializer, visit_u64 as u64);
|
||||
primitive_deserializer!(f32, F32Deserializer, visit_f32);
|
||||
primitive_deserializer!(f64, F64Deserializer, visit_f64);
|
||||
primitive_deserializer!(char, CharDeserializer, visit_char);
|
||||
@@ -233,9 +232,9 @@ impl<'a, E> de::Deserializer for StrDeserializer<'a, E>
|
||||
}
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit option seq seq_fixed_size bytes map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct
|
||||
struct struct_field tuple ignored_any byte_buf
|
||||
}
|
||||
}
|
||||
|
||||
@@ -291,9 +290,9 @@ impl<E> de::Deserializer for StringDeserializer<E>
|
||||
}
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit option seq seq_fixed_size bytes map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct
|
||||
struct struct_field tuple ignored_any byte_buf
|
||||
}
|
||||
}
|
||||
|
||||
@@ -353,9 +352,9 @@ impl<'a, E> de::Deserializer for CowStrDeserializer<'a, E>
|
||||
}
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit option seq seq_fixed_size bytes map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct
|
||||
struct struct_field tuple ignored_any byte_buf
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,9 +425,9 @@ impl<I, T, E> de::Deserializer for SeqDeserializer<I, E>
|
||||
}
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit option seq seq_fixed_size bytes map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple enum ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct
|
||||
struct struct_field tuple enum ignored_any byte_buf
|
||||
}
|
||||
}
|
||||
|
||||
@@ -538,9 +537,9 @@ impl<V_, E> de::Deserializer for SeqVisitorDeserializer<V_, E>
|
||||
}
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit option seq seq_fixed_size bytes map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple enum ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct
|
||||
struct struct_field tuple enum ignored_any byte_buf
|
||||
}
|
||||
}
|
||||
|
||||
@@ -634,9 +633,9 @@ impl<I, E> de::Deserializer for MapDeserializer<I, E>
|
||||
}
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit option bytes map unit_struct newtype_struct tuple_struct struct
|
||||
struct_field tuple enum ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
bytes map unit_struct newtype_struct tuple_struct struct struct_field
|
||||
tuple enum ignored_any byte_buf
|
||||
}
|
||||
}
|
||||
|
||||
@@ -728,9 +727,9 @@ impl<A, B, E> de::Deserializer for PairDeserializer<A, B, E>
|
||||
type Error = E;
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit option bytes map unit_struct newtype_struct tuple_struct struct
|
||||
struct_field tuple enum ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
bytes map unit_struct newtype_struct tuple_struct struct struct_field
|
||||
tuple enum ignored_any byte_buf
|
||||
}
|
||||
|
||||
fn deserialize<V>(self, visitor: V) -> Result<V::Value, Self::Error>
|
||||
@@ -872,9 +871,9 @@ impl<V_, E> de::Deserializer for MapVisitorDeserializer<V_, E>
|
||||
}
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit option seq seq_fixed_size bytes map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple enum ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct
|
||||
struct struct_field tuple enum ignored_any byte_buf
|
||||
}
|
||||
}
|
||||
|
||||
@@ -905,9 +904,9 @@ impl<'a, E> de::Deserializer for BytesDeserializer<'a, E>
|
||||
}
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit option seq seq_fixed_size bytes map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple enum ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct
|
||||
struct struct_field tuple enum ignored_any byte_buf
|
||||
}
|
||||
}
|
||||
|
||||
@@ -941,9 +940,9 @@ impl<E> de::Deserializer for ByteBufDeserializer<E>
|
||||
}
|
||||
|
||||
forward_to_deserialize! {
|
||||
bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
unit option seq seq_fixed_size bytes map unit_struct newtype_struct
|
||||
tuple_struct struct struct_field tuple enum ignored_any byte_buf
|
||||
bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
seq seq_fixed_size bytes map unit_struct newtype_struct tuple_struct
|
||||
struct struct_field tuple enum ignored_any byte_buf
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+6
-12
@@ -32,9 +32,6 @@ macro_rules! forward_to_deserialize_helper {
|
||||
(bool) => {
|
||||
forward_to_deserialize_method!{deserialize_bool()}
|
||||
};
|
||||
(usize) => {
|
||||
forward_to_deserialize_method!{deserialize_usize()}
|
||||
};
|
||||
(u8) => {
|
||||
forward_to_deserialize_method!{deserialize_u8()}
|
||||
};
|
||||
@@ -47,9 +44,6 @@ macro_rules! forward_to_deserialize_helper {
|
||||
(u64) => {
|
||||
forward_to_deserialize_method!{deserialize_u64()}
|
||||
};
|
||||
(isize) => {
|
||||
forward_to_deserialize_method!{deserialize_isize()}
|
||||
};
|
||||
(i8) => {
|
||||
forward_to_deserialize_method!{deserialize_i8()}
|
||||
};
|
||||
@@ -154,9 +148,9 @@ macro_rules! forward_to_deserialize_helper {
|
||||
/// self.deserialize(visitor)
|
||||
/// }
|
||||
/// # forward_to_deserialize! {
|
||||
/// # usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str string
|
||||
/// # unit option seq seq_fixed_size bytes byte_buf map unit_struct
|
||||
/// # newtype_struct tuple_struct struct struct_field tuple enum ignored_any
|
||||
/// # u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
/// # seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct
|
||||
/// # tuple_struct struct struct_field tuple enum ignored_any
|
||||
/// # }
|
||||
/// # }
|
||||
/// # fn main() {}
|
||||
@@ -181,9 +175,9 @@ macro_rules! forward_to_deserialize_helper {
|
||||
/// }
|
||||
///
|
||||
/// forward_to_deserialize! {
|
||||
/// bool usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 char str
|
||||
/// string unit option seq seq_fixed_size bytes byte_buf map unit_struct
|
||||
/// newtype_struct tuple_struct struct struct_field tuple enum ignored_any
|
||||
/// bool u8 u16 u32 u64 i8 i16 i32 i64 f32 f64 char str string unit option
|
||||
/// seq seq_fixed_size bytes byte_buf map unit_struct newtype_struct
|
||||
/// tuple_struct struct struct_field tuple enum ignored_any
|
||||
/// }
|
||||
/// }
|
||||
/// # fn main() {}
|
||||
|
||||
@@ -74,25 +74,25 @@ use super::Iterator;
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
macro_rules! impl_visit {
|
||||
($ty:ty, $method:ident) => {
|
||||
($ty:ty, $method:ident $($cast:tt)*) => {
|
||||
impl Serialize for $ty {
|
||||
#[inline]
|
||||
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
|
||||
where S: Serializer,
|
||||
{
|
||||
serializer.$method(*self)
|
||||
serializer.$method(*self $($cast)*)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl_visit!(bool, serialize_bool);
|
||||
impl_visit!(isize, serialize_isize);
|
||||
impl_visit!(isize, serialize_i64 as i64);
|
||||
impl_visit!(i8, serialize_i8);
|
||||
impl_visit!(i16, serialize_i16);
|
||||
impl_visit!(i32, serialize_i32);
|
||||
impl_visit!(i64, serialize_i64);
|
||||
impl_visit!(usize, serialize_usize);
|
||||
impl_visit!(usize, serialize_u64 as u64);
|
||||
impl_visit!(u8, serialize_u8);
|
||||
impl_visit!(u16, serialize_u16);
|
||||
impl_visit!(u32, serialize_u32);
|
||||
|
||||
+5
-19
@@ -179,7 +179,7 @@ pub trait Serialize {
|
||||
/// data structure supported by Serde.
|
||||
///
|
||||
/// The role of this trait is to define the serialization half of the Serde data
|
||||
/// model, which is a way to categorize every Rust data structure into one of 30
|
||||
/// model, which is a way to categorize every Rust data structure into one of 28
|
||||
/// possible types. Each method of the `Serializer` trait corresponds to one of
|
||||
/// the types of the data model.
|
||||
///
|
||||
@@ -188,13 +188,13 @@ pub trait Serialize {
|
||||
///
|
||||
/// The types that make up the Serde data model are:
|
||||
///
|
||||
/// - 15 primitive types:
|
||||
/// - 12 primitive types:
|
||||
/// - bool
|
||||
/// - isize, i8, i16, i32, i64
|
||||
/// - usize, u8, u16, u32, u64
|
||||
/// - i8, i16, i32, i64
|
||||
/// - u8, u16, u32, u64
|
||||
/// - f32, f64
|
||||
/// - char
|
||||
/// - string
|
||||
/// - string
|
||||
/// - byte array - [u8]
|
||||
/// - option
|
||||
/// - either none or some value
|
||||
@@ -279,13 +279,6 @@ pub trait Serializer {
|
||||
/// Serialize a `bool` value.
|
||||
fn serialize_bool(self, v: bool) -> Result<Self::Ok, Self::Error>;
|
||||
|
||||
/// Serialize an `isize` value.
|
||||
///
|
||||
/// If the format does not differentiate between `isize` and `i64`, a
|
||||
/// reasonable implementation would be to cast the value to `i64` and
|
||||
/// forward to `serialize_i64`.
|
||||
fn serialize_isize(self, v: isize) -> Result<Self::Ok, Self::Error>;
|
||||
|
||||
/// Serialize an `i8` value.
|
||||
///
|
||||
/// If the format does not differentiate between `i8` and `i64`, a
|
||||
@@ -310,13 +303,6 @@ pub trait Serializer {
|
||||
/// Serialize an `i64` value.
|
||||
fn serialize_i64(self, v: i64) -> Result<Self::Ok, Self::Error>;
|
||||
|
||||
/// Serialize a `usize` value.
|
||||
///
|
||||
/// If the format does not differentiate between `usize` and `u64`, a
|
||||
/// reasonable implementation would be to cast the value to `u64` and
|
||||
/// forward to `serialize_u64`.
|
||||
fn serialize_usize(self, v: usize) -> Result<Self::Ok, Self::Error>;
|
||||
|
||||
/// Serialize a `u8` value.
|
||||
///
|
||||
/// If the format does not differentiate between `u8` and `u64`, a
|
||||
|
||||
Reference in New Issue
Block a user