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>,
},
}
Expand description
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
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
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
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
contest_id: i64
contestId of a contest (can be seen in the url of a contest, eg.
/contest/1485
).
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
contest_id: i64
contestId of a contest (can be seen in the url of a contest, eg.
/contest/1485
).
Trait Implementations§
Source§impl CFAPIRequestable for CFContestCommand
impl CFAPIRequestable for CFContestCommand
Source§fn query_params(&self) -> Vec<(&'static str, String)>
fn query_params(&self) -> Vec<(&'static str, String)>
Source§fn method_name(&self) -> &'static str
fn method_name(&self) -> &'static str
Source§impl Clone for CFContestCommand
impl Clone for CFContestCommand
Source§fn clone(&self) -> CFContestCommand
fn clone(&self) -> CFContestCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CFContestCommand
impl Debug for CFContestCommand
Source§impl PartialEq for CFContestCommand
impl PartialEq for CFContestCommand
impl Eq for CFContestCommand
impl StructuralPartialEq for CFContestCommand
Auto Trait Implementations§
impl Freeze for CFContestCommand
impl RefUnwindSafe for CFContestCommand
impl Send for CFContestCommand
impl Sync for CFContestCommand
impl Unpin for CFContestCommand
impl UnwindSafe for CFContestCommand
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key
and return true
if they are equal.