Skip to main content

KeyedRosterAssignment

Struct KeyedRosterAssignment 

Source
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>

Source

pub const fn denominator(&self) -> &KeyedRoster<D, K, N>

The complete caller-keyed denominator retained by this assignment.

Source

pub const fn payloads(&self) -> &KeyedRoster<P, S, N>

The payload roster aligned with the denominator and keyed by caller-declared seats.

Source

pub fn count(&self) -> usize

How many denominator members and aligned payloads are held.

Source

pub const fn first(&self) -> (&K, &D, &S, &P)

The first denominator member and its assigned payload.

Source

pub fn indexed(&self) -> impl Iterator<Item = (usize, &K, &D, &S, &P)>

Reads every denominator member and aligned payload in denominator order.

Source

pub fn at(&self, index: usize) -> Option<(&K, &D, &S, &P)>

Reads one denominator member and aligned payload at a checked index.

Source

pub fn get<Q>(&self, sought: &Q) -> Option<(&D, &S, &P)>
where K: Borrow<Q>, Q: Eq + ?Sized,

Finds one denominator member and aligned payload through a borrowed key.

Source§

impl<D, K: Eq, P, S: Eq, const N: usize> KeyedRosterAssignment<D, K, P, S, N>

Source

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>

Source§

fn clone(&self) -> KeyedRosterAssignment<D, K, P, S, N>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<D: Debug, K: Debug, P: Debug, S: Debug, const N: usize> Debug for KeyedRosterAssignment<D, K, P, S, N>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<D: Eq, K: Eq, P: Eq, S: Eq, const N: usize> Eq for KeyedRosterAssignment<D, K, P, S, N>

Source§

impl<D: Hash, K: Hash, P: Hash, S: Hash, const N: usize> Hash for KeyedRosterAssignment<D, K, P, S, N>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<D: PartialEq, K: PartialEq, P: PartialEq, S: PartialEq, const N: usize> PartialEq for KeyedRosterAssignment<D, K, P, S, N>

Source§

fn eq(&self, other: &KeyedRosterAssignment<D, K, P, S, N>) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl<D: PartialEq, K: PartialEq, P: PartialEq, S: PartialEq, const N: usize> StructuralPartialEq for KeyedRosterAssignment<D, K, P, S, N>

Auto Trait Implementations§

§

impl<D, K, P, S, const N: usize> Freeze for KeyedRosterAssignment<D, K, P, S, N>
where KeyedRoster<D, K, N>: Freeze, KeyedRoster<P, S, N>: Freeze,

§

impl<D, K, P, S, const N: usize> RefUnwindSafe for KeyedRosterAssignment<D, K, P, S, N>

§

impl<D, K, P, S, const N: usize> Send for KeyedRosterAssignment<D, K, P, S, N>
where KeyedRoster<D, K, N>: Send, KeyedRoster<P, S, N>: Send,

§

impl<D, K, P, S, const N: usize> Sync for KeyedRosterAssignment<D, K, P, S, N>
where KeyedRoster<D, K, N>: Sync, KeyedRoster<P, S, N>: Sync,

§

impl<D, K, P, S, const N: usize> Unpin for KeyedRosterAssignment<D, K, P, S, N>
where KeyedRoster<D, K, N>: Unpin, KeyedRoster<P, S, N>: Unpin,

§

impl<D, K, P, S, const N: usize> UnsafeUnpin for KeyedRosterAssignment<D, K, P, S, N>
where KeyedRoster<D, K, N>: UnsafeUnpin, KeyedRoster<P, S, N>: UnsafeUnpin,

§

impl<D, K, P, S, const N: usize> UnwindSafe for KeyedRosterAssignment<D, K, P, S, N>
where KeyedRoster<D, K, N>: UnwindSafe, KeyedRoster<P, S, N>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.