fastvarint 0.22.0

fast varint encode/decode that supports wide compatibility
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use std::fmt::Display;

use crate::DecodeVarIntError;

pub trait EncodeVarInt {
    fn encode_var_int<F: FnOnce(&[u8]) -> R, R>(&self, write: F) -> R;
}

pub trait DecodeVarInt: Sized {
    fn decode_var_int<F: FnMut(usize) -> Result<Option<u8>, E>, E: Display>(
        reader: F,
    ) -> Result<(Self, usize), DecodeVarIntError<E>>;
}