pub enum ParticipationDiff {
AllZeros(usize),
Sparse {
sparse_indices: Vec<u8>,
new_values: Vec<u8>,
extension: Vec<u8>,
},
}Expand description
Compact delta encoding for participation flags.
A participation delta stores only the information required to transform one participation vector into another.
The encoder automatically selects the most compact representation:
ParticipationDiff::AllZeroswhen the target vector contains only zero-valued flags.ParticipationDiff::Sparsewhen only a subset of indices change.
This type is intended to be serialized using rkyv.
Variants§
AllZeros(usize)
Represents a participation vector consisting entirely of zeros.
During reconstruction the destination vector is resized to len
and every entry is set to 0.
Sparse
Sparse delta representation.
Only indices whose values differ from the base vector are stored.
Changed indices are encoded as delta-varint gaps to reduce storage requirements for sparsely changing participation flags.
Fields
sparse_indices: Vec<u8>Delta-varint encoded gaps between successive modified indices.
Each decoded gap is added to the previous modified index to recover the absolute index.
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.