Struct ink_storage::collections::bitvec::ChunkRef [−][src]
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]
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]
Auto Trait Implementations
impl<T> RefUnwindSafe for ChunkRef<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for ChunkRef<T> where
T: Send,
T: Send,
impl<T> Sync for ChunkRef<T> where
T: Sync,
T: Sync,
impl<T> Unpin for ChunkRef<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for ChunkRef<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,