Struct multi_skill::data_processing::Contest[][src]

pub struct Contest {
    pub name: String,
    pub url: Option<String>,
    pub weight: f64,
    pub time_seconds: u64,
    pub standings: Vec<(String, usize, usize)>,
}

Represents the outcome of a contest.

Fields

name: String

A human-readable title for the contest.

url: Option<String>

The source URL, if any.

weight: f64

The relative weight of a contest, default is 1.

time_seconds: u64

The number of seconds from the Unix Epoch to the end of the contest.

standings: Vec<(String, usize, usize)>

The list of standings, containing a name and the enclosing range of ties.

Implementations

impl Contest[src]

pub fn new(index: usize) -> Self[src]

Create a contest with empty standings, useful for testing.

pub fn find_contestant(&mut self, handle: &str) -> Option<usize>[src]

pub fn has_contestant(&mut self, handle: &str) -> bool[src]

Detect if a given contestant exists

pub fn remove_contestant(
    &mut self,
    handle: &str
) -> Option<(String, usize, usize)>
[src]

Remove a contestant with the given handle, and return it if it exists.

pub fn push_contestant(&mut self, handle: impl Into<String>)[src]

Add a contestant with the given handle in last place.

Trait Implementations

impl<'de> Deserialize<'de> for Contest[src]

impl Serialize for Contest[src]

impl TryFrom<Vec<CFRatingChange, Global>> for Contest[src]

type Error = String

The type returned in the event of a conversion error.

fn try_from(json_contest: Vec<CFRatingChange>) -> Result<Self, Self::Error>[src]

Checks the integrity of our API response and convert it into a more convenient format.

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> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

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

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

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.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,