pub struct Bitmap {
bytes: Vec<u8>,
n_inputs: u32,
}Expand description
A Bitmap used to request proof elements in Utreexo proofs.
This bitmap represents which inputs the sender needs in the proof.
Each bit in the bitmap corresponds to an input in the block, where true means
the input should be included in the proof.
Fields§
§bytes: Vec<u8>The actual bytes representing the bitmap.
n_inputs: u32How many elements have been pushed into the bitmap.
Implementations§
Source§impl Bitmap
impl Bitmap
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new empty Bitmap.
Use the push_input method to add inputs to the bitmap.
Sourcepub fn push_input(&mut self, request: bool)
pub fn push_input(&mut self, request: bool)
Adds a new input to the bitmap.
This method takes a boolean request which indicates whether the input
should be requested from our remote peer.
Trait Implementations§
Source§impl Ord for Bitmap
impl Ord for Bitmap
Source§impl PartialOrd for Bitmap
impl PartialOrd for Bitmap
impl Eq for Bitmap
impl StructuralPartialEq for Bitmap
Auto Trait Implementations§
impl Freeze for Bitmap
impl RefUnwindSafe for Bitmap
impl Send for Bitmap
impl Sync for Bitmap
impl Unpin for Bitmap
impl UnwindSafe for Bitmap
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.