pub trait IntegerEncoding:
Clone
+ Copy
+ Debug
+ Eq
+ Hash
+ Ord
+ PartialEq
+ PartialOrd
+ Sealed {
// Required methods
fn encode_unsigned<C, W, T>(
cx: &mut C,
writer: W,
value: T,
) -> Result<(), <C as Context>::Error>
where C: Context<Input = <W as Writer>::Error>,
W: Writer,
T: ByteOrderIo;
fn decode_unsigned<'de, C, R, T>(
cx: &mut C,
reader: R,
) -> Result<T, <C as Context>::Error>
where C: Context<Input = <R as Reader<'de>>::Error>,
R: Reader<'de>,
T: ByteOrderIo;
fn encode_signed<C, W, T>(
cx: &mut C,
writer: W,
value: T,
) -> Result<(), <C as Context>::Error>
where C: Context<Input = <W as Writer>::Error>,
W: Writer,
T: Signed,
<T as Signed>::Unsigned: ByteOrderIo;
fn decode_signed<'de, C, R, T>(
cx: &mut C,
reader: R,
) -> Result<T, <C as Context>::Error>
where C: Context<Input = <R as Reader<'de>>::Error>,
R: Reader<'de>,
T: Signed,
<T as Signed>::Unsigned: ByteOrderIo<Signed = T>;
}Expand description
Required Methods§
Sourcefn encode_unsigned<C, W, T>(
cx: &mut C,
writer: W,
value: T,
) -> Result<(), <C as Context>::Error>
fn encode_unsigned<C, W, T>( cx: &mut C, writer: W, value: T, ) -> Result<(), <C as Context>::Error>
Governs how unsigned integers are encoded into a Writer.
Sourcefn decode_unsigned<'de, C, R, T>(
cx: &mut C,
reader: R,
) -> Result<T, <C as Context>::Error>
fn decode_unsigned<'de, C, R, T>( cx: &mut C, reader: R, ) -> Result<T, <C as Context>::Error>
Governs how unsigned integers are decoded from a Reader.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl IntegerEncoding for Variable
IntegerEncoding and UsizeEncoding implementation which encodes integers using zigzag variable length encoding.