Struct ink_storage::collections::bitvec::ChunkRef[][src]

#[repr(C)]pub struct ChunkRef<T> { /* fields omitted */ }

A reference to a subslice within a 256-bit chunk.

This is a reference wrapper around either a shared 256-bit chunk or an exclusive 256-bit chunk. Also it prevents accesses to out of bounds bits.

Implementations

impl<T> ChunkRef<T>[src]

pub fn len(&self) -> u32[src]

Returns the length of the 256-bit chunk.

Note

This is the number of valid bits in the chunk of 256 bits. The valid bits are consecutive and always start from index 0.

impl<'a> ChunkRef<&'a Bits256>[src]

pub fn position_first_zero(&self) -> Option<u8>[src]

Returns the position of the first valid zero bit if any.

pub fn get(&self, index: u8) -> Option<bool>[src]

Returns the value of the indexed bit.

Note

  • If 0: returns false
  • If 1: returns true

impl<'a> ChunkRef<&'a mut Bits256>[src]

pub fn get_mut(&mut self, index: u8) -> Option<BitRefMut<'_>>[src]

Returns mutable access to a single bit if the index is out of bounds.

Trait Implementations

impl<T: Clone> Clone for ChunkRef<T>[src]

impl<T: Copy> Copy for ChunkRef<T>[src]

impl<T: Debug> Debug for ChunkRef<T>[src]

impl<'a> Deref for ChunkRef<&'a mut Bits256>[src]

type Target = ChunkRef<&'a Bits256>

The resulting type after dereferencing.

Auto Trait Implementations

impl<T> RefUnwindSafe for ChunkRef<T> where
    T: RefUnwindSafe

impl<T> Send for ChunkRef<T> where
    T: Send

impl<T> Sync for ChunkRef<T> where
    T: Sync

impl<T> Unpin for ChunkRef<T> where
    T: Unpin

impl<T> UnwindSafe for ChunkRef<T> where
    T: UnwindSafe

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> From<T> for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

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<V, T> VZip<V> for T where
    V: MultiLane<T>,