pub struct StickyAssignor;Expand description
Keep what you had where possible, Java’s StickyAssignor in spirit.
Not Java’s algorithm. Java’s does a balanced-then-shuffle pass with several refinement rounds; this keeps each member’s still-valid partitions and deals the rest to whoever holds fewest. The results agree on the cases tested here and will not agree on every case.
That difference is only safe because the leader’s assignment is the one
used — a mixed group is consistent whoever leads, it just gets a slightly
different balance depending. Where exact agreement is required, use
range or roundrobin, which are reproduced exactly.
Trait Implementations§
Source§impl Assignor for StickyAssignor
impl Assignor for StickyAssignor
Source§impl Clone for StickyAssignor
impl Clone for StickyAssignor
Source§fn clone(&self) -> StickyAssignor
fn clone(&self) -> StickyAssignor
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for StickyAssignor
Source§impl Debug for StickyAssignor
impl Debug for StickyAssignor
Source§impl Default for StickyAssignor
impl Default for StickyAssignor
Source§fn default() -> StickyAssignor
fn default() -> StickyAssignor
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for StickyAssignor
impl RefUnwindSafe for StickyAssignor
impl Send for StickyAssignor
impl Sync for StickyAssignor
impl Unpin for StickyAssignor
impl UnsafeUnpin for StickyAssignor
impl UnwindSafe for StickyAssignor
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