pub trait AllowedLenBitString {
const ALLOWED_LEN_RANGE: RangeInclusive<u16>;
// Provided method
fn check_bit_len(bit_len: u16) -> Result<(), Error> { ... }
}Expand description
Trait automatically derived on structs, by the BitString macro.
Used for checking if binary data fits into defined struct.
/// Bit length of 2
struct MyBitString {
flag1: bool,
flag2: bool,
}ⓘ
use der::BitString;
/// Bit length of 3..=4
#[derive(BitString)]
struct MyBitString {
flag1: bool,
flag2: bool,
flag3: bool,
#[asn1(optional = "true")]
flag4: bool,
}Required Associated Constants§
Sourceconst ALLOWED_LEN_RANGE: RangeInclusive<u16>
const ALLOWED_LEN_RANGE: RangeInclusive<u16>
Implementer must specify how many bits are allowed
Provided Methods§
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.