Struct etterna::Wifescore[][src]

pub struct Wifescore { /* fields omitted */ }

Wifescore struct. Guaranteed to be a valid value, i.e. <= 100% and not NaN (may be negative infinity though)

Implementations

impl Wifescore[src]

pub const D_THRESHOLD: Self[src]

pub const C_THRESHOLD: Self[src]

pub const B_THRESHOLD: Self[src]

pub const A_THRESHOLD: Self[src]

pub const AA_THRESHOLD: Self[src]

pub const AAA_THRESHOLD: Self[src]

pub const AAAA_THRESHOLD: Self[src]

pub const AAAAA_THRESHOLD: Self[src]

pub fn from_percent(percent: f32) -> Option<Self>[src]

Makes a Wifescore from a value, assumed to be scaled to a max of 100

Returns None if the percentage is over 100%, or if it is infinite or NaN

pub fn from_proportion(proportion: f32) -> Option<Self>[src]

Makes a Wifescore from a value, assumed to be scaled to a max of 1

Returns None if the proportion is over 1.0 (100%), or if it is infinite or NaN

pub fn as_percent(self) -> f32[src]

Returns the wifescore, scaled to a max of 100

pub fn as_proportion(self) -> f32[src]

Returns the wifescore, scaled to a max of 1

Trait Implementations

impl Clone for Wifescore[src]

impl Copy for Wifescore[src]

impl Debug for Wifescore[src]

impl Default for Wifescore[src]

impl Display for Wifescore[src]

impl Eq for Wifescore[src]

impl Ord for Wifescore[src]

impl PartialEq<Wifescore> for Wifescore[src]

impl PartialOrd<Wifescore> for Wifescore[src]

impl StructuralPartialEq for Wifescore[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.