pub struct Strict;Expand description
Selects LEB128 decoding that rejects non-canonical integer encodings.
Use this zero-sized policy as the second type parameter of
crate::Leb128Codec or crate::ZigZagCodec when input must use its
shortest valid representation. Encoding remains canonical regardless of
the selected policy.
§Examples
use qubit_codec_binary::{Leb128Codec, Strict};
let input = [0x80, 0x00];
let result = unsafe { Leb128Codec::<u16, Strict>::decode(&input, 0) };
assert!(result.is_err());Trait Implementations§
impl Copy for Strict
impl Eq for Strict
Source§impl Leb128DecodePolicy for Strict
impl Leb128DecodePolicy for Strict
impl StructuralPartialEq for Strict
Auto Trait Implementations§
impl Forget for Strict
impl Freeze for Strict
impl RefUnwindSafe for Strict
impl Send for Strict
impl Sync for Strict
impl Unpin for Strict
impl UnsafeUnpin for Strict
impl UnwindSafe for Strict
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more