pub struct BaseMergeAccumulator {
pub image_owner: HashMap<i64, RankId>,
pub seen_rank_ids: HashSet<RankId>,
pub strict: bool,
}Expand description
Cross-partial state that every paradigm’s merge accumulator shares: image-id ownership (for the disjoint-partition rule) and strict-mode rank-id distinctness.
Paradigms wrap this in their own outer accumulator and call
Self::ingest_rank_id + Self::ingest_image_ids from their
ingest per partial, before folding the paradigm-specific body.
Fields§
§image_owner: HashMap<i64, RankId>Image id → rank that ingested it. Source of truth for the
merged seen_images set.
seen_rank_ids: HashSet<RankId>Rank ids observed so far. Only populated in strict mode (the distinctness invariant is strict-only); empty in corrected.
strict: boolWhether the receiver is in strict mode.
Implementations§
Source§impl BaseMergeAccumulator
impl BaseMergeAccumulator
Sourcepub fn new(strict: bool) -> Self
pub fn new(strict: bool) -> Self
Construct an empty accumulator. strict controls whether the
rank-id distinctness check fires.
Sourcepub fn ingest_rank_id(
&mut self,
rank_id: Option<RankId>,
) -> Result<(), PartialError>
pub fn ingest_rank_id( &mut self, rank_id: Option<RankId>, ) -> Result<(), PartialError>
Record one partial’s rank_id. In strict mode, returns
PartialError::RankCollision if a previous partial declared
the same id. In corrected mode this is a no-op.
Sourcepub fn ingest_image_ids(
&mut self,
rank_id: Option<RankId>,
image_ids: impl IntoIterator<Item = i64>,
) -> Result<(), PartialError>
pub fn ingest_image_ids( &mut self, rank_id: Option<RankId>, image_ids: impl IntoIterator<Item = i64>, ) -> Result<(), PartialError>
Record one partial’s seen_images against its declared
rank_id. Returns PartialError::PartitionOverlap if any
image_id was already registered by a different rank.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BaseMergeAccumulator
impl RefUnwindSafe for BaseMergeAccumulator
impl Send for BaseMergeAccumulator
impl Sync for BaseMergeAccumulator
impl Unpin for BaseMergeAccumulator
impl UnsafeUnpin for BaseMergeAccumulator
impl UnwindSafe for BaseMergeAccumulator
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> 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> 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.