[][src]Struct grin_chain::txhashset::BitmapChunk

pub struct BitmapChunk(_);

A bitmap "chunk" representing 1024 contiguous bits of the overall bitmap. The first 1024 bits belong in one chunk. The next 1024 bits in the next chunk, etc.

Methods

impl BitmapChunk[src]

pub fn new() -> BitmapChunk[src]

Create a new bitmap chunk, defaulting all bits in the chunk to false.

pub fn set(&mut self, idx: u64, value: bool)[src]

Set a single bit in this chunk. 0-indexed from start of chunk. Panics if idx is outside the valid range of bits in a chunk.

pub fn any(&self) -> bool[src]

Does this bitmap chunk have any bits set to 1?

Trait Implementations

impl Clone for BitmapChunk[src]

impl Debug for BitmapChunk[src]

impl DefaultHashable for BitmapChunk[src]

impl PMMRable for BitmapChunk[src]

type E = Self

The type of element actually stored in the MMR data file. This allows us to store Hash elements in the header MMR for variable size BlockHeaders. Read more

impl Readable for BitmapChunk[src]

fn read(_reader: &mut dyn Reader) -> Result<BitmapChunk, Error>[src]

Reading is not currently supported, just return an empty one for now. We store the underlying roaring bitmap externally for the bitmap accumulator and the "hash only" backend means we never actually read these chunks.

impl Writeable for BitmapChunk[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CloneAny for T where
    T: Clone + Any

impl<T> DebugAny for T where
    T: Any + Debug

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync

impl<T> Erased for T

impl<T> From<T> for T[src]

impl<D> Hashed for D where
    D: DefaultHashable
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone

impl<T> PMMRIndexHashable for T where
    T: DefaultHashable
[src]

impl<T> SafeBorrow<T> for T where
    T: ?Sized

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<H> ShortIdentifiable for H where
    H: Hashed
[src]

fn short_id(&self, hash: &Hash, nonce: u64) -> ShortId[src]

Generate a short_id via the following -

  • extract k0/k1 from block_hash hashed with the nonce (first two u64 values) * initialize a siphasher24 with k0/k1
    • self.hash() passing in the siphasher24 instance
    • drop the 2 most significant bytes (to return a 6 byte short_id)

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> UnsafeAny for T where
    T: Any

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,