leb128fmt 0.1.0
README badge
[](https://proofs.rs/crate/leb128fmt?version=0.1.0)A library to encode and decode LEB128 compressed integers.
Reports (1)
Findings (4)
APIs (38)
APIClaims · findings
Functions
pub const fn decode_s32(input: [u8; 5]) -> Option<(i32, usize)>1 claimpub const fn decode_s64(input: [u8; 10]) -> Option<(i64, usize)>1 claimpub fn decode_sint_slice<T, const BITS: u32>(input: &[u8], pos: &mut usize) -> Result<T, Error> where T: core::ops::Shl<u32, Output = T> + core::ops::BitOrAssign + From<i8> + From<u8> + SInt4 claimspub const fn decode_u32(input: [u8; 5]) -> Option<(u32, usize)>1 claimpub const fn decode_u64(input: [u8; 10]) -> Option<(u64, usize)>1 claimpub fn decode_uint_slice<T, const BITS: u32>(input: &[u8], pos: &mut usize) -> Result<T, Error> where T: core::ops::Shl<u32, Output = T> + core::ops::BitOrAssign + From<u8> + UInt10 claimspub const fn encode_fixed_s32(value: i32) -> Option<[u8; 5]>1 claimpub const fn encode_fixed_s64(value: i64) -> Option<[u8; 10]>1 claimpub fn encode_fixed_sint_slice<T, const BITS: u32>(value: T, output: &mut [u8], pos: &mut usize) -> Option<usize> where T: Copy + PartialEq + core::ops::BitAnd + core::ops::Shr<u32> + core::ops::ShrAssign<u32> + From<i8> + SInt, <T as core::ops::Shr<u32>>::Output: PartialEq<T>, u8: TryFrom<<T as core::ops::BitAnd>::Output>5 claimspub const fn encode_fixed_u32(value: u32) -> Option<[u8; 5]>1 claimpub const fn encode_fixed_u64(value: u64) -> Option<[u8; 10]>1 claimpub fn encode_fixed_uint_slice<T, const BITS: u32>(value: T, output: &mut [u8], pos: &mut usize) -> Option<usize> where T: Copy + core::ops::BitAnd + core::ops::Shr<u32> + core::ops::ShrAssign<u32> + From<u8> + UInt, <T as core::ops::Shr<u32>>::Output: PartialEq<T>, u8: TryFrom<<T as core::ops::BitAnd>::Output>5 claimspub fn encode_s32(value: i32) -> Option<([u8; 5], usize)>1 claimpub fn encode_s64(value: i64) -> Option<([u8; 10], usize)>1 claimpub fn encode_sint_slice<T, const BITS: u32>(value: T, output: &mut [u8], pos: &mut usize) -> Option<usize> where T: Copy + PartialEq + core::ops::BitAnd + core::ops::Shr<u32> + core::ops::ShrAssign<u32> + From<i8> + SInt, <T as core::ops::Shr<u32>>::Output: PartialEq<T>, u8: TryFrom<<T as core::ops::BitAnd<T>>::Output>5 claimspub const fn encode_u32(value: u32) -> Option<([u8; 5], usize)>1 claimpub const fn encode_u64(value: u64) -> Option<([u8; 10], usize)>1 claimpub fn encode_uint_slice<T, const BITS: u32>(value: T, output: &mut [u8], pos: &mut usize) -> Option<usize> where T: Copy + PartialEq + core::ops::BitAnd + core::ops::Shr<u32> + core::ops::ShrAssign<u32> + From<u8> + UInt, <T as core::ops::Shr<u32>>::Output: PartialEq<T>, u8: TryFrom<<T as core::ops::BitAnd<T>>::Output>5 claimsAssociated functions
No associated functions.
Methods
impl Error
pub const fn is_invalid_encoding(self: &Self) -> bool1 claimpub const fn is_more_bytes_needed(self: &Self) -> bool1 claimTrait implementations
impl core::clone::Clone for Error
impl core::cmp::PartialEq for Error
impl core::error::Error for Error
impl core::fmt::Debug for Error
pub fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result—impl core::fmt::Display for Error
pub fn fmt(self: &Self, f: &mut fmt::Formatter<'_>) -> fmt::Result—Blanket implementations
impl alloc::borrow::ToOwned for Error
pub fn clone_into(self: &Self, target: &mut T)—pub fn to_owned(self: &Self) -> T—impl alloc::string::ToString for Error
pub fn to_string(self: &Self) -> String—impl core::any::Any for Error
pub fn type_id(self: &Self) -> TypeId—impl core::borrow::Borrow<T> for Error
pub fn borrow(self: &Self) -> &T—impl core::borrow::BorrowMut<T> for Error
pub fn borrow_mut(self: &mut Self) -> &mut T—impl core::clone::CloneToUninit for Error
pub unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)—impl core::convert::From<T> for Error
pub fn from(t: T) -> T—impl core::convert::Into<U> for Error
pub fn into(self: Self) -> U—impl core::convert::TryFrom<U> for Error
pub fn try_from(value: U) -> Result<T, never>—impl core::convert::TryInto<U> for Error
pub fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>—