pub struct AlgorithmFlags(/* private fields */);Expand description
Typed view of the algorithm flags byte from a decoded
CompactReceipt.
§Examples
use h33_substrate_verifier::AlgorithmFlags;
let flags = AlgorithmFlags::from_byte(0b0000_0111);
assert!(flags.has_dilithium());
assert!(flags.has_falcon());
assert!(flags.has_sphincs());
assert_eq!(flags.count(), 3);Implementations§
Source§impl AlgorithmFlags
impl AlgorithmFlags
Sourcepub const fn from_byte(byte: u8) -> Self
pub const fn from_byte(byte: u8) -> Self
Construct from a raw byte. Does not validate that the bits are
recognized — use
validated_from_byte for that.
Sourcepub const fn validated_from_byte(byte: u8) -> Result<Self, VerifierError>
pub const fn validated_from_byte(byte: u8) -> Result<Self, VerifierError>
Construct from a raw byte, returning an error if unknown bits are set.
Sourcepub const fn has_dilithium(self) -> bool
pub const fn has_dilithium(self) -> bool
Does the flag set include Dilithium?
Sourcepub const fn has_falcon(self) -> bool
pub const fn has_falcon(self) -> bool
Does the flag set include FALCON?
Sourcepub const fn has_sphincs(self) -> bool
pub const fn has_sphincs(self) -> bool
Does the flag set include SPHINCS+?
Trait Implementations§
Source§impl Clone for AlgorithmFlags
impl Clone for AlgorithmFlags
Source§fn clone(&self) -> AlgorithmFlags
fn clone(&self) -> AlgorithmFlags
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AlgorithmFlags
impl Debug for AlgorithmFlags
Source§impl PartialEq for AlgorithmFlags
impl PartialEq for AlgorithmFlags
impl Copy for AlgorithmFlags
impl Eq for AlgorithmFlags
impl StructuralPartialEq for AlgorithmFlags
Auto Trait Implementations§
impl Freeze for AlgorithmFlags
impl RefUnwindSafe for AlgorithmFlags
impl Send for AlgorithmFlags
impl Sync for AlgorithmFlags
impl Unpin for AlgorithmFlags
impl UnsafeUnpin for AlgorithmFlags
impl UnwindSafe for AlgorithmFlags
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