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§

source

fn u16_size(n: u16) -> u64

Gets the size (in bytes) that a value would be serialized to.

source

fn u32_size(n: u32) -> u64

Gets the size (in bytes) that a value would be serialized to.

source

fn u64_size(n: u64) -> u64

Gets the size (in bytes) that a value would be serialized to.

source

fn i16_size(n: i16) -> u64

Gets the size (in bytes) that a value would be serialized to.

source

fn i32_size(n: i32) -> u64

Gets the size (in bytes) that a value would be serialized to.

source

fn i64_size(n: i64) -> u64

Gets the size (in bytes) that a value would be serialized to.

source

fn serialize_u16<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: u16, ) -> Result<()>

source

fn serialize_u32<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: u32, ) -> Result<()>

source

fn serialize_u64<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: u64, ) -> Result<()>

source

fn serialize_i16<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: i16, ) -> Result<()>

source

fn serialize_i32<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: i32, ) -> Result<()>

source

fn serialize_i64<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: i64, ) -> Result<()>

source

fn deserialize_u16<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<u16>

source

fn deserialize_u32<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<u32>

source

fn deserialize_u64<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<u64>

source

fn deserialize_i16<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<i16>

source

fn deserialize_i32<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<i32>

source

fn deserialize_i64<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<i64>

source

fn u128_size(v: u128) -> u64

source

fn i128_size(v: i128) -> u64

source

fn serialize_u128<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: u128, ) -> Result<()>

source

fn deserialize_u128<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<u128>

source

fn serialize_i128<W: Write, O: Options>( ser: &mut Serializer<W, O>, val: i128, ) -> Result<()>

source

fn deserialize_i128<'de, R: BincodeRead<'de>, O: Options>( de: &mut Deserializer<R, O>, ) -> Result<i128>

Provided Methods§

source

fn len_size(len: usize) -> u64

source

fn serialize_len<W: Write, O: Options>( ser: &mut Serializer<W, O>, len: usize, ) -> Result<()>

Serializes a sequence length.

source

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.

Implementors§