pub struct PQLFraction { /* private fields */ }Expand description
Exact rational number used for equity pot shares.
Implementations§
Source§impl PQLFraction
impl PQLFraction
Sourcepub const fn new(num: i32, den: i32) -> PQLFraction
pub const fn new(num: i32, den: i32) -> PQLFraction
Builds a fraction from a numerator and denominator.
Sourcepub const fn zero() -> PQLFraction
pub const fn zero() -> PQLFraction
Returns 0 / 1.
Returns a hero’s share of the pot when tied with n_winners players.
§Panics
won’t panic since n_winners ≤ 10
Trait Implementations§
Source§impl Clone for PQLFraction
impl Clone for PQLFraction
Source§fn clone(&self) -> PQLFraction
fn clone(&self) -> PQLFraction
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 PQLFraction
impl Debug for PQLFraction
Source§impl Display for PQLFraction
impl Display for PQLFraction
Source§impl PartialEq for PQLFraction
impl PartialEq for PQLFraction
impl Copy for PQLFraction
impl Eq for PQLFraction
impl StructuralPartialEq for PQLFraction
Auto Trait Implementations§
impl Freeze for PQLFraction
impl RefUnwindSafe for PQLFraction
impl Send for PQLFraction
impl Sync for PQLFraction
impl Unpin for PQLFraction
impl UnsafeUnpin for PQLFraction
impl UnwindSafe for PQLFraction
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<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