Enum codeforces_api::requests::CFContestCommand[][src]

pub enum CFContestCommand {
    Hacks {
        contest_id: i64,
    },
    List {
        gym: Option<bool>,
    },
    RatingChanges {
        contest_id: i64,
    },
    Standings {
        contest_id: i64,
        from: Option<i64>,
        count: Option<i64>,
        handles: Option<Vec<String>>,
        room: Option<i64>,
        show_unofficial: Option<bool>,
    },
    Status {
        contest_id: i64,
        handle: Option<String>,
        from: Option<i64>,
        count: Option<i64>,
    },
}

Wrapper enum for all API methods of form contest.<method>.

More details for the contest command can be found here.

Variants

Hacks

Struct for sending contest.hacks requests to the Codeforces API.

Returns list of hacks in the specified contest. Full information about hacks is available only after some time after the contest end. During the contest, a user can see only their own hacks.

If correctly parsed, the response object will be of type responses::CFResult::CFHackVec.

More details for the contest.hacks command can be found here.

Examples

let x = CFContestCommand::Hacks {
    contest_id: 1485,
};
 
match x.get(api_key, api_secret) {
    Ok(CFResult::CFHackVec(v)) => {
        // your code here
    },
    _ => {
        panic!("API request failed");
    }
}

Fields of Hacks

contest_id: i64

contestId of a contest (can be seen in the url of a contest, eg. /contest/1485).

List

Struct for sending contest.list requests to the Codeforces API.

Returns information about all available contests.

If correctly parsed, the response object will be of type responses::CFResult::CFContestVec.

More details for the contest.list command can be found here.

Examples

let x = CFContestCommand::List {
    gym: Some(false),
};
 
match x.get(api_key, api_secret) {
    Ok(CFResult::CFContestVec(v)) => {
        // your code here
    },
    _ => {
        panic!("API request failed");
    }
}

Fields of List

gym: Option<bool>

If Some(true), then gym contests are returned. Otherwise, regular contests are returned.

RatingChanges

Struct for sending contest.ratingChanges requests to the Codeforces API.

Returns rating changes after a specified contest.

If correctly parsed, the response object will be of type responses::CFResult::CFRatingChangeVec.

More details for the contest.ratingChanges command can be found here.

Examples

let x = CFContestCommand::RatingChanges {
    contest_id: 1485,
};
 
match x.get(api_key, api_secret) {
    Ok(CFResult::CFRatingChangeVec(v)) => {
        // your code here
    },
    _ => {
        panic!("API request failed");
    }
}

Fields of RatingChanges

contest_id: i64

contestId of a contest (can be seen in the url of a contest, eg. /contest/1485).

Standings

Struct for sending contest.standings requests to the Codeforces API.

Returns a description of a specified contest as well as the requested part of the standings.

If correctly parsed, the response object will be of type responses::CFResult::CFContestStandings.

More details for the contest.standings command can be found here.

Examples

let x = CFContestCommand::Standings {
    contest_id: 1485,
    from: Some(1),
    count: Some(3),
    handles: Some(vec!["thud".to_string()]),
    room: None,
    show_unofficial: Some(false),
};
 
match x.get(api_key, api_secret) {
    Ok(CFResult::CFContestStandings(s)) => {
        // your code here
    },
    _ => {
        panic!("API request failed");
    }
}

Fields of Standings

contest_id: i64

contestId of a contest (can be seen in the url of a contest, eg. /contest/1485).

from: Option<i64>

1-based index of the standings row to start the ranklist (most recent first).

count: Option<i64>

Number of standing rows to return.

handles: Option<Vec<String>>

Vec of handles. No more than 10000 handles is allowed by Codeforces.

room: Option<i64>

If specified, then only participants from this room will be shown in the result. If not, all the participants will be shown.

show_unofficial: Option<bool>

If true, then all participants (virtual, out of competition) are shown. Otherwise, only official contestants are shown.

Status

Struct for sending contest.status requests to the Codeforces API.

Returns submissions for specified contest. Optionally can return submissions of specified user.

If correctly parsed, the response object will be of type responses::CFResult::CFSubmissionVec.

More details for the contest.status command can be found here.

Examples

let x = CFContestCommand::Status {
    contest_id: 1485,
    handle: None,
    from: Some(1),
    count: Some(3),
};
 
match x.get(api_key, api_secret) {
    Ok(CFResult::CFSubmissionVec(v)) => {
        // your code here
    },
    _ => {
        panic!("API request failed");
    }
}

Fields of Status

contest_id: i64

contestId of a contest (can be seen in the url of a contest, eg. /contest/1485).

handle: Option<String>

If specified, then only this user's submissions are returned.

from: Option<i64>

1-based index of the standings row to start the ranklist (most recent first).

count: Option<i64>

Number of submissions to return.

Trait Implementations

impl CFAPIRequestable for CFContestCommand[src]

impl Clone for CFContestCommand[src]

impl Debug for CFContestCommand[src]

impl Eq for CFContestCommand[src]

impl PartialEq<CFContestCommand> for CFContestCommand[src]

impl StructuralEq for CFContestCommand[src]

impl StructuralPartialEq for CFContestCommand[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<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[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> Same<T> for T

type Output = T

Should always be Self

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

type Owned = T

The resulting type after obtaining ownership.

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>,