pub enum CFProblemsetCommand {
Problems {
tags: Option<Vec<String>>,
problemset_name: Option<String>,
},
RecentStatus {
count: i64,
problemset_name: Option<String>,
},
}
Expand description
Wrapper enum for all API methods of form problemset.<method>
.
More details for the problemset command can be found here.
Variants§
Problems
Struct for sending problemset.problems
requests to the Codeforces API.
Returns all problems from problemset. Problems can be filtered by tags.
If correctly parsed, the response object will be of type
responses::CFResult::CFProblemset
.
More details for the problemset.problems
command can be found
here.
§Examples
let x = CFProblemsetCommand::Problems {
tags: Some(vec!["dp".to_string(), "greedy".to_string()]),
problemset_name: None,
};
match x.get(api_key, api_secret) {
Ok(CFResult::CFProblemset(p)) => {
// your code here
},
_ => {
panic!("API request failed");
}
}
Fields
Optional Vec of tags to search for (eg. “dp”).
RecentStatus
Struct for sending problemset.recentStatus
requests to the Codeforces
API.
Returns recent submissions.
If correctly parsed, the response object will be of type
responses::CFResult::CFSubmissionVec
.
More details for the problemset.recentStatus
command can be found
here.
§Examples
let x = CFProblemsetCommand::RecentStatus {
count: 10,
problemset_name: None,
};
match x.get(api_key, api_secret) {
Ok(CFResult::CFSubmissionVec(v)) => {
// your code here
},
_ => {
panic!("API request failed");
}
}
Trait Implementations§
Source§impl CFAPIRequestable for CFProblemsetCommand
impl CFAPIRequestable for CFProblemsetCommand
Source§fn query_params(&self) -> Vec<(&'static str, String)>
fn query_params(&self) -> Vec<(&'static str, String)>
Method which returns a Vec of pairs (key, val) which will be mapped
onto URL query parameters. Used internally and not much use for most
people.
Source§fn method_name(&self) -> &'static str
fn method_name(&self) -> &'static str
Method which returns a str slice of the method name (eg. “user.info”).
Used internally and not much use for most
people.
Source§impl Clone for CFProblemsetCommand
impl Clone for CFProblemsetCommand
Source§fn clone(&self) -> CFProblemsetCommand
fn clone(&self) -> CFProblemsetCommand
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 CFProblemsetCommand
impl Debug for CFProblemsetCommand
Source§impl PartialEq for CFProblemsetCommand
impl PartialEq for CFProblemsetCommand
impl Eq for CFProblemsetCommand
impl StructuralPartialEq for CFProblemsetCommand
Auto Trait Implementations§
impl Freeze for CFProblemsetCommand
impl RefUnwindSafe for CFProblemsetCommand
impl Send for CFProblemsetCommand
impl Sync for CFProblemsetCommand
impl Unpin for CFProblemsetCommand
impl UnwindSafe for CFProblemsetCommand
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<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
Compare self to
key
and return true
if they are equal.