pub enum ParticipationDiff {
AllZeros(usize),
Sparse {
sparse_indices: Vec<u8>,
new_values: Vec<u8>,
extension: Vec<u8>,
},
}Expand description
Compact delta representation for Ethereum participation flags.
The encoder selects between a dense all-zero representation and a sparse representation depending on the target vector.
This type is intended to be serialized using rkyv.
Variants§
AllZeros(usize)
Represents a target participation vector containing only zero flags.
During application, the destination vector is cleared and resized to
len, with every entry initialized to zero.
Sparse
Sparse representation containing only changed participation flags.
The changed indices are stored as delta-varint encoded gaps in
sparse_indices. Each decoded index corresponds positionally to one
value in new_values.
Fields
sparse_indices: Vec<u8>Delta-varint encoded gaps between successive changed indices.
Starting from index zero, each decoded gap advances the current index to the next changed entry.
Trait Implementations§
Source§impl Archive for ParticipationDiff
impl Archive for ParticipationDiff
Source§type Archived = ArchivedParticipationDiff
type Archived = ArchivedParticipationDiff
Source§type Resolver = ParticipationDiffResolver
type Resolver = ParticipationDiffResolver
Source§fn resolve(
&self,
resolver: <Self as Archive>::Resolver,
out: Place<<Self as Archive>::Archived>,
)
fn resolve( &self, resolver: <Self as Archive>::Resolver, out: Place<<Self as Archive>::Archived>, )
Source§const COPY_OPTIMIZATION: CopyOptimization<Self> = _
const COPY_OPTIMIZATION: CopyOptimization<Self> = _
serialize. Read moreSource§impl Clone for ParticipationDiff
impl Clone for ParticipationDiff
Source§fn clone(&self) -> ParticipationDiff
fn clone(&self) -> ParticipationDiff
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ParticipationDiff
impl Debug for ParticipationDiff
Source§impl<__D: Fallible + ?Sized> Deserialize<ParticipationDiff, __D> for Archived<ParticipationDiff>
impl<__D: Fallible + ?Sized> Deserialize<ParticipationDiff, __D> for Archived<ParticipationDiff>
Source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<ParticipationDiff, <__D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<ParticipationDiff, <__D as Fallible>::Error>
impl Eq for ParticipationDiff
Source§impl PartialEq for ParticipationDiff
impl PartialEq for ParticipationDiff
impl StructuralPartialEq for ParticipationDiff
Auto Trait Implementations§
impl Freeze for ParticipationDiff
impl RefUnwindSafe for ParticipationDiff
impl Send for ParticipationDiff
impl Sync for ParticipationDiff
impl Unpin for ParticipationDiff
impl UnsafeUnpin for ParticipationDiff
impl UnwindSafe for ParticipationDiff
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.