pub struct BendableScore<const H: usize, const S: usize> { /* private fields */ }Implementations§
Source§impl<const H: usize, const S: usize> BendableScore<H, S>
impl<const H: usize, const S: usize> BendableScore<H, S>
pub const fn of(hard: [i64; H], soft: [i64; S]) -> BendableScore<H, S>
pub const fn zero() -> BendableScore<H, S>
pub const fn hard_levels_count(&self) -> usize
pub const fn soft_levels_count(&self) -> usize
Sourcepub const fn hard_score(&self, level: usize) -> i64
pub const fn hard_score(&self, level: usize) -> i64
Sourcepub const fn soft_score(&self, level: usize) -> i64
pub const fn soft_score(&self, level: usize) -> i64
pub const fn hard_scores(&self) -> &[i64; H]
pub const fn soft_scores(&self) -> &[i64; S]
pub const fn one_hard(level: usize) -> BendableScore<H, S>
pub const fn one_soft(level: usize) -> BendableScore<H, S>
Trait Implementations§
Source§impl<const H: usize, const S: usize> Add for BendableScore<H, S>
impl<const H: usize, const S: usize> Add for BendableScore<H, S>
Source§type Output = BendableScore<H, S>
type Output = BendableScore<H, S>
The resulting type after applying the
+ operator.Source§fn add(self, other: BendableScore<H, S>) -> BendableScore<H, S>
fn add(self, other: BendableScore<H, S>) -> BendableScore<H, S>
Performs the
+ operation. Read moreSource§impl<const H: usize, const S: usize> Clone for BendableScore<H, S>
impl<const H: usize, const S: usize> Clone for BendableScore<H, S>
Source§fn clone(&self) -> BendableScore<H, S>
fn clone(&self) -> BendableScore<H, S>
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<const H: usize, const S: usize> Default for BendableScore<H, S>
impl<const H: usize, const S: usize> Default for BendableScore<H, S>
Source§fn default() -> BendableScore<H, S>
fn default() -> BendableScore<H, S>
Returns the “default value” for a type. Read more
Source§impl<const H: usize, const S: usize> Neg for BendableScore<H, S>
impl<const H: usize, const S: usize> Neg for BendableScore<H, S>
Source§type Output = BendableScore<H, S>
type Output = BendableScore<H, S>
The resulting type after applying the
- operator.Source§fn neg(self) -> BendableScore<H, S>
fn neg(self) -> BendableScore<H, S>
Performs the unary
- operation. Read moreSource§impl<const H: usize, const S: usize> Ord for BendableScore<H, S>
impl<const H: usize, const S: usize> Ord for BendableScore<H, S>
Source§fn cmp(&self, other: &BendableScore<H, S>) -> Ordering
fn cmp(&self, other: &BendableScore<H, S>) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<const H: usize, const S: usize> PartialOrd for BendableScore<H, S>
impl<const H: usize, const S: usize> PartialOrd for BendableScore<H, S>
Source§impl<const H: usize, const S: usize> Score for BendableScore<H, S>
impl<const H: usize, const S: usize> Score for BendableScore<H, S>
fn is_feasible(&self) -> bool
fn zero() -> BendableScore<H, S>
fn levels_count() -> usize
fn to_level_numbers(&self) -> Vec<i64>
fn from_level_numbers(levels: &[i64]) -> BendableScore<H, S>
fn multiply(&self, multiplicand: f64) -> BendableScore<H, S>
fn divide(&self, divisor: f64) -> BendableScore<H, S>
fn abs(&self) -> BendableScore<H, S>
fn level_label(index: usize) -> ScoreLevel
fn to_scalar(&self) -> f64
fn compare(&self, other: &Self) -> Ordering
fn is_better_than(&self, other: &Self) -> bool
fn is_worse_than(&self, other: &Self) -> bool
fn is_equal_to(&self, other: &Self) -> bool
fn one_hard() -> Self
fn one_soft() -> Self
fn one_medium() -> Self
Source§impl<const H: usize, const S: usize> Sub for BendableScore<H, S>
impl<const H: usize, const S: usize> Sub for BendableScore<H, S>
Source§type Output = BendableScore<H, S>
type Output = BendableScore<H, S>
The resulting type after applying the
- operator.Source§fn sub(self, other: BendableScore<H, S>) -> BendableScore<H, S>
fn sub(self, other: BendableScore<H, S>) -> BendableScore<H, S>
Performs the
- operation. Read moreimpl<const H: usize, const S: usize> Copy for BendableScore<H, S>
impl<const H: usize, const S: usize> Eq for BendableScore<H, S>
impl<const H: usize, const S: usize> StructuralPartialEq for BendableScore<H, S>
Auto Trait Implementations§
impl<const H: usize, const S: usize> Freeze for BendableScore<H, S>
impl<const H: usize, const S: usize> RefUnwindSafe for BendableScore<H, S>
impl<const H: usize, const S: usize> Send for BendableScore<H, S>
impl<const H: usize, const S: usize> Sync for BendableScore<H, S>
impl<const H: usize, const S: usize> Unpin for BendableScore<H, S>
impl<const H: usize, const S: usize> UnsafeUnpin for BendableScore<H, S>
impl<const H: usize, const S: usize> UnwindSafe for BendableScore<H, S>
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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