pub struct Signers { /* private fields */ }Expand description
Bitmap wrapper that tracks which participants signed a certificate.
Internally, it stores bits in 1-byte chunks for compact encoding.
Implementations§
Source§impl Signers
impl Signers
Sourcepub fn new(
participants: u32,
signers: impl IntoIterator<Item = Participant>,
) -> Result<Self, AssemblyError>
pub fn new( participants: u32, signers: impl IntoIterator<Item = Participant>, ) -> Result<Self, AssemblyError>
Builds Signers from an iterator of signer indices.
Indices need not be sorted: some signing schemes aggregate commutatively, so ordering is left to the caller.
Sourcepub const fn len(&self) -> usize
pub const fn len(&self) -> usize
Returns the length of the bitmap (the size of the participant set).
Sourcepub fn iter(&self) -> impl Iterator<Item = Participant> + '_
pub fn iter(&self) -> impl Iterator<Item = Participant> + '_
Iterates over signer indices in ascending order.
Trait Implementations§
Source§impl EncodeSize for Signers
impl EncodeSize for Signers
Source§fn encode_size(&self) -> usize
fn encode_size(&self) -> usize
Returns the encoded size of this value (in bytes).
Source§fn encode_inline_size(&self) -> usize
fn encode_inline_size(&self) -> usize
Returns the encoded size excluding bytes passed to
BufsMut::push
during Write::write_bufs. Used to size the fixed working buffer for
inline writes, so it must not be less than the bytes written inline.
Override alongside Write::write_bufs for types where large
byte fields go via push, or the working buffer will over-allocate.impl Eq for Signers
Source§impl Read for Signers
impl Read for Signers
impl StructuralPartialEq for Signers
Source§impl<'a, P, I> TryFrom<(&'a Set<P>, I)> for Signerswhere
I: IntoIterator<Item = Participant>,
Builds Signers using the participant set as the valid signer-index range.
impl<'a, P, I> TryFrom<(&'a Set<P>, I)> for Signerswhere
I: IntoIterator<Item = Participant>,
Builds Signers using the participant set as the valid signer-index range.
§Panics
Panics if the participant count exceeds u32::MAX.
Source§impl<'a, V, I> TryFrom<(&'a Sharing<V>, I)> for Signers
Builds Signers using the sharing’s participant bound and recovery threshold.
impl<'a, V, I> TryFrom<(&'a Sharing<V>, I)> for Signers
Builds Signers using the sharing’s participant bound and recovery threshold.
Source§impl Write for Signers
impl Write for Signers
Source§fn write_bufs(&self, buf: &mut impl BufsMut)
fn write_bufs(&self, buf: &mut impl BufsMut)
Writes to a
BufsMut, allowing existing byte chunks to be
appended via BufsMut::push instead of written inline. Must encode
to the same format as Write::write. Defaults to Write::write.Auto Trait Implementations§
impl Freeze for Signers
impl RefUnwindSafe for Signers
impl Send for Signers
impl Sync for Signers
impl Unpin for Signers
impl UnsafeUnpin for Signers
impl UnwindSafe for Signers
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