pub struct Bitlist<const N: u64> { /* private fields */ }Expand description
SSZ Bitlist with a compile-time bit cap of N.
Wire format: packed bits (LSB-first within bytes), followed by a
sentinel 1 bit immediately after the data bits. The sentinel marks
the end of the logical bitstream and is not part of the bit content.
Implementations§
Trait Implementations§
Source§impl<const N: u64> Decode for Bitlist<N>
impl<const N: u64> Decode for Bitlist<N>
Source§fn is_ssz_fixed_len() -> bool
fn is_ssz_fixed_len() -> bool
true iff this type is fixed-length.Source§fn ssz_fixed_len() -> usize
fn ssz_fixed_len() -> usize
Number of bytes this type occupies in the fixed-length portion of a
container encoding. Variable-length types return
BYTES_PER_LENGTH_OFFSET.Source§fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
fn from_ssz_bytes(bytes: &[u8]) -> Result<Self, DecodeError>
Decode a full instance from
bytes, rejecting trailing input.Source§impl<const N: u64> Encode for Bitlist<N>
impl<const N: u64> Encode for Bitlist<N>
Source§fn is_ssz_fixed_len() -> bool
fn is_ssz_fixed_len() -> bool
true iff this type is fixed-length (no variable-length fields).Source§fn ssz_fixed_len() -> usize
fn ssz_fixed_len() -> usize
Number of bytes this type occupies in the fixed-length portion of a
container encoding. For variable-length types this returns
BYTES_PER_LENGTH_OFFSET (i.e. the size of the offset slot).Source§fn ssz_bytes_len(&self) -> usize
fn ssz_bytes_len(&self) -> usize
Total size of
self when serialized.Source§fn ssz_append(&self, buf: &mut Vec<u8>)
fn ssz_append(&self, buf: &mut Vec<u8>)
Append the encoding of
self to buf.Source§fn is_basic_type() -> bool
fn is_basic_type() -> bool
true for “basic” SSZ types (uintN, bool), which pack adjacent
elements into shared 32-byte chunks for merkleization. Composite
types (containers, lists, structs) return false (the default).Source§impl<const N: u64> HashTreeRoot for Bitlist<N>
impl<const N: u64> HashTreeRoot for Bitlist<N>
impl<const N: u64> Eq for Bitlist<N>
Auto Trait Implementations§
impl<const N: u64> Freeze for Bitlist<N>
impl<const N: u64> RefUnwindSafe for Bitlist<N>
impl<const N: u64> Send for Bitlist<N>
impl<const N: u64> Sync for Bitlist<N>
impl<const N: u64> Unpin for Bitlist<N>
impl<const N: u64> UnsafeUnpin for Bitlist<N>
impl<const N: u64> UnwindSafe for Bitlist<N>
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