pub struct KeyedRosterAssignment<D, K, P, S, const N: usize> { /* private fields */ }Expand description
One payload assignment for every member of a caller-keyed denominator roster.
The denominator and payload rosters share denominator order by construction.
Implementations§
Source§impl<D, K, P, S, const N: usize> KeyedRosterAssignment<D, K, P, S, N>
impl<D, K, P, S, const N: usize> KeyedRosterAssignment<D, K, P, S, N>
Sourcepub const fn denominator(&self) -> &KeyedRoster<D, K, N>
pub const fn denominator(&self) -> &KeyedRoster<D, K, N>
The complete caller-keyed denominator retained by this assignment.
Sourcepub const fn payloads(&self) -> &KeyedRoster<P, S, N>
pub const fn payloads(&self) -> &KeyedRoster<P, S, N>
The payload roster aligned with the denominator and keyed by caller-declared seats.
Sourcepub const fn first(&self) -> (&K, &D, &S, &P)
pub const fn first(&self) -> (&K, &D, &S, &P)
The first denominator member and its assigned payload.
Sourcepub fn indexed(&self) -> impl Iterator<Item = (usize, &K, &D, &S, &P)>
pub fn indexed(&self) -> impl Iterator<Item = (usize, &K, &D, &S, &P)>
Reads every denominator member and aligned payload in denominator order.
Source§impl<D, K: Eq, P, S: Eq, const N: usize> KeyedRosterAssignment<D, K, P, S, N>
impl<D, K: Eq, P, S: Eq, const N: usize> KeyedRosterAssignment<D, K, P, S, N>
Sourcepub fn complete(
denominator: KeyedRoster<D, K, N>,
payloads: Vec<P>,
reference_of: impl FnMut(&P) -> K,
seat_of: impl FnMut(&P) -> S,
) -> Result<Self, KeyedRosterAssignmentError<K, S, N>>
pub fn complete( denominator: KeyedRoster<D, K, N>, payloads: Vec<P>, reference_of: impl FnMut(&P) -> K, seat_of: impl FnMut(&P) -> S, ) -> Result<Self, KeyedRosterAssignmentError<K, S, N>>
Completes one payload assignment over an existing caller-keyed denominator.
Payload magnitude is settled before either key projection runs. Reference membership and uniqueness are settled before payload-seat keys are projected.
§Errors
Returns KeyedRosterAssignmentError with the first structural refusal class reached by the declared construction order.
Trait Implementations§
Source§impl<D: Clone, K: Clone, P: Clone, S: Clone, const N: usize> Clone for KeyedRosterAssignment<D, K, P, S, N>
impl<D: Clone, K: Clone, P: Clone, S: Clone, const N: usize> Clone for KeyedRosterAssignment<D, K, P, S, N>
Source§fn clone(&self) -> KeyedRosterAssignment<D, K, P, S, N>
fn clone(&self) -> KeyedRosterAssignment<D, K, P, S, N>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more