Trait bincode::config::int::IntEncoding
source · pub trait IntEncoding {
Show 27 methods
// Required methods
fn u16_size(n: u16) -> u64;
fn u32_size(n: u32) -> u64;
fn u64_size(n: u64) -> u64;
fn i16_size(n: i16) -> u64;
fn i32_size(n: i32) -> u64;
fn i64_size(n: i64) -> u64;
fn serialize_u16<W: Write, O: Options>(
ser: &mut Serializer<W, O>,
val: u16,
) -> Result<()>;
fn serialize_u32<W: Write, O: Options>(
ser: &mut Serializer<W, O>,
val: u32,
) -> Result<()>;
fn serialize_u64<W: Write, O: Options>(
ser: &mut Serializer<W, O>,
val: u64,
) -> Result<()>;
fn serialize_i16<W: Write, O: Options>(
ser: &mut Serializer<W, O>,
val: i16,
) -> Result<()>;
fn serialize_i32<W: Write, O: Options>(
ser: &mut Serializer<W, O>,
val: i32,
) -> Result<()>;
fn serialize_i64<W: Write, O: Options>(
ser: &mut Serializer<W, O>,
val: i64,
) -> Result<()>;
fn deserialize_u16<'de, R: BincodeRead<'de>, O: Options>(
de: &mut Deserializer<R, O>,
) -> Result<u16>;
fn deserialize_u32<'de, R: BincodeRead<'de>, O: Options>(
de: &mut Deserializer<R, O>,
) -> Result<u32>;
fn deserialize_u64<'de, R: BincodeRead<'de>, O: Options>(
de: &mut Deserializer<R, O>,
) -> Result<u64>;
fn deserialize_i16<'de, R: BincodeRead<'de>, O: Options>(
de: &mut Deserializer<R, O>,
) -> Result<i16>;
fn deserialize_i32<'de, R: BincodeRead<'de>, O: Options>(
de: &mut Deserializer<R, O>,
) -> Result<i32>;
fn deserialize_i64<'de, R: BincodeRead<'de>, O: Options>(
de: &mut Deserializer<R, O>,
) -> Result<i64>;
fn u128_size(v: u128) -> u64;
fn i128_size(v: i128) -> u64;
fn serialize_u128<W: Write, O: Options>(
ser: &mut Serializer<W, O>,
val: u128,
) -> Result<()>;
fn deserialize_u128<'de, R: BincodeRead<'de>, O: Options>(
de: &mut Deserializer<R, O>,
) -> Result<u128>;
fn serialize_i128<W: Write, O: Options>(
ser: &mut Serializer<W, O>,
val: i128,
) -> Result<()>;
fn deserialize_i128<'de, R: BincodeRead<'de>, O: Options>(
de: &mut Deserializer<R, O>,
) -> Result<i128>;
// Provided methods
fn len_size(len: usize) -> u64 { ... }
fn serialize_len<W: Write, O: Options>(
ser: &mut Serializer<W, O>,
len: usize,
) -> Result<()> { ... }
fn deserialize_len<'de, R: BincodeRead<'de>, O: Options>(
de: &mut Deserializer<R, O>,
) -> Result<usize> { ... }
}
Required Methods§
fn serialize_u16<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: u16, ) -> Result<()>
fn serialize_u32<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: u32, ) -> Result<()>
fn serialize_u64<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: u64, ) -> Result<()>
fn serialize_i16<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: i16, ) -> Result<()>
fn serialize_i32<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: i32, ) -> Result<()>
fn serialize_i64<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: i64, ) -> Result<()>
fn deserialize_u16<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<u16>
fn deserialize_u32<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<u32>
fn deserialize_u64<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<u64>
fn deserialize_i16<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<i16>
fn deserialize_i32<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<i32>
fn deserialize_i64<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<i64>
fn u128_size(v: u128) -> u64
fn i128_size(v: i128) -> u64
fn serialize_u128<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: u128, ) -> Result<()>
fn deserialize_u128<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<u128>
fn serialize_i128<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: i128, ) -> Result<()>
fn deserialize_i128<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<i128>
Provided Methods§
fn len_size(len: usize) -> u64
sourcefn serialize_len<W: Write, O: Options>(
ser: &mut Serializer<W, O>,
len: usize,
) -> Result<()>
fn serialize_len<W: Write, O: Options>( ser: &mut Serializer<W, O>, len: usize, ) -> Result<()>
Serializes a sequence length.
sourcefn deserialize_len<'de, R: BincodeRead<'de>, O: Options>(
de: &mut Deserializer<R, O>,
) -> Result<usize>
fn deserialize_len<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<usize>
Deserializes a sequence length.
Object Safety§
This trait is not object safe.