Skip to main content

Leb128DecodePolicy

Trait Leb128DecodePolicy 

Source
pub trait Leb128DecodePolicy:
    Sealed
    + Copy
    + Default {
    const STRICT: bool;
}
Expand description

Describes a type-level LEB128 decoding policy.

This trait is sealed because the current LEB128 decoder only supports the two built-in canonicality modes represented by crate::Strict and crate::NonStrict.

§Examples

use qubit_codec_binary::{Leb128DecodePolicy, NonStrict, Strict};

assert!(Strict::STRICT);
assert!(!NonStrict::STRICT);
ⓘ
use qubit_codec_binary::Leb128DecodePolicy;

#[derive(Clone, Copy, Default)]
struct ExternalPolicy;

impl Leb128DecodePolicy for ExternalPolicy {
    const STRICT: bool = false;
}

Required Associated Constants§

Source

const STRICT: bool

Whether this policy rejects non-canonical encodings.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§