pub struct PermutationSpace {
slots: Vec<SlotCandidates>,
contested_indices: Vec<usize>,
total: u64,
contested_count: u32,
total_candidates: u32,
}Expand description
Cartesian product space.
Fields§
§slots: Vec<SlotCandidates>§contested_indices: Vec<usize>§total: u64§contested_count: u32§total_candidates: u32Implementations§
Source§impl PermutationSpace
impl PermutationSpace
Sourcepub fn validate(&self) -> Result<(), PermutationError>
pub fn validate(&self) -> Result<(), PermutationError>
Validate all structural and derived invariants.
§Errors
Returns an error for empty or oversized candidate sets and inconsistent derived fields. Cardinalities not exactly representable by the JavaScript API are also rejected.
pub fn slots(&self) -> &[SlotCandidates]
pub fn contested_indices(&self) -> &[usize]
pub const fn total(&self) -> u64
pub const fn contested_count(&self) -> u32
pub const fn total_candidates(&self) -> u32
Sourcepub fn picks(&self, index: u64) -> Vec<(GearSlot, &Candidate)>
pub fn picks(&self, index: u64) -> Vec<(GearSlot, &Candidate)>
Full item picks for a combination index.
pub fn contested_slots(&self) -> Vec<&SlotCandidates>
Trait Implementations§
Source§impl Clone for PermutationSpace
impl Clone for PermutationSpace
Source§fn clone(&self) -> PermutationSpace
fn clone(&self) -> PermutationSpace
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PermutationSpace
impl Debug for PermutationSpace
Source§impl<'de> Deserialize<'de> for PermutationSpace
impl<'de> Deserialize<'de> for PermutationSpace
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PermutationSpace
impl PartialEq for PermutationSpace
Source§impl Serialize for PermutationSpace
impl Serialize for PermutationSpace
Source§impl Tsify for PermutationSpace
impl Tsify for PermutationSpace
const DECL: &'static str = "/**\n * Cartesian product space.\n */\nexport interface PermutationSpace {\n slots: SlotCandidates[];\n contestedIndices: number[];\n total: number;\n contestedCount: number;\n totalCandidates: number;\n}"
const SERIALIZATION_CONFIG: SerializationConfig
type JsType = JsType
fn into_js(&self) -> Result<Self::JsType, Error>where
Self: Serialize,
fn from_js<T>(js: T) -> Result<Self, Error>
impl StructuralPartialEq for PermutationSpace
Auto Trait Implementations§
impl Freeze for PermutationSpace
impl RefUnwindSafe for PermutationSpace
impl Send for PermutationSpace
impl Sync for PermutationSpace
impl Unpin for PermutationSpace
impl UnsafeUnpin for PermutationSpace
impl UnwindSafe for PermutationSpace
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more