pub enum CFUserCommand {
BlogEntries {
handle: String,
},
Friends {
only_online: Option<bool>,
},
Info {
handles: Vec<String>,
},
RatedList {
active_only: Option<bool>,
},
Rating {
handle: String,
},
Status {
handle: String,
from: Option<i64>,
count: Option<i64>,
},
}Expand description
Wrapper enum for all API methods of form user.<method>.
More details for the user command can be found here.
Variants§
BlogEntries
Struct for sending user.blogEntries requests to the Codeforces
API.
Returns a list with all of a specified user’s blog entries.
If correctly parsed, the response object will be of type
responses::CFResult::CFBlogEntryVec.
More details for the user.blogEntries command can be found
here.
§Examples
let x = CFUserCommand::BlogEntries {
handle: "thud".to_string(),
};
match x.get(api_key, api_secret) {
Ok(CFResult::CFBlogEntryVec(v)) => {
// your code here
},
_ => {
panic!("API request failed");
}
}Friends
Struct for sending user.friends requests to the Codeforces API.
Returns authorized user’s friends (ie. the friends of the user who owns the API keys in use).
If correctly parsed, the response object will be of type
responses::CFResult::CFFriends.
More details for the user.friends command can be found
here.
§Examples
let x = CFUserCommand::Friends {
only_online: None,
};
match x.get(api_key, api_secret) {
Ok(CFResult::CFFriends(v)) => {
// your code here
},
_ => {
panic!("API request failed");
}
}Fields
Info
Struct for sending user.info requests to the Codeforces API.
Returns information about one or several users.
If correctly parsed, the response object will be of type
responses::CFResult::CFUserVec.
More details for the user.info command can be found
here.
§Examples
let x = CFUserCommand::Info {
handles: vec!["thud".to_string()],
};
match x.get(api_key, api_secret) {
Ok(CFResult::CFUserVec(v)) => {
// your code here
},
_ => {
panic!("API request failed");
}
}Fields
RatedList
Struct for sending user.ratedList requests to the Codeforces API.
Returns the list of users who have participated in at least one rated contest.
If correctly parsed, the response object will be of type
responses::CFResult::CFUserVec.
More details for the user.ratedList command can be found
here.
§Examples
let x = CFUserCommand::RatedList {
active_only: Some(true),
};
match x.get(api_key, api_secret) {
Ok(CFResult::CFUserVec(v)) => {
// your code here
},
_ => {
panic!("API request failed");
}
}Fields
Rating
Struct for sending user.rating requests to the Codeforces API.
Returns the rating history of a specified user.
If correctly parsed, the response object will be of type
responses::CFResult::CFRatingChangeVec.
More details for the user.rating command can be found
here.
§Examples
let x = CFUserCommand::Rating {
handle: "thud".to_string(),
};
match x.get(api_key, api_secret) {
Ok(CFResult::CFRatingChangeVec(v)) => {
// your code here
},
_ => {
panic!("API request failed");
}
}Status
Struct for sending user.status requests to the Codeforces API.
Returns the submissions of a specified user.
If correctly parsed, the response object will be of type
responses::CFResult::CFSubmissionVec.
More details for the user.status command can be found
here.
§Examples
let x = CFUserCommand::Status {
handle: "thud".to_string(),
from: Some(1),
count: Some(3),
};
match x.get(api_key, api_secret) {
Ok(CFResult::CFSubmissionVec(v)) => {
// your code here
},
_ => {
panic!("API request failed");
}
}Trait Implementations§
Source§impl CFAPIRequestable for CFUserCommand
impl CFAPIRequestable for CFUserCommand
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 CFUserCommand
impl Clone for CFUserCommand
Source§fn clone(&self) -> CFUserCommand
fn clone(&self) -> CFUserCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CFUserCommand
impl Debug for CFUserCommand
Source§impl PartialEq for CFUserCommand
impl PartialEq for CFUserCommand
impl Eq for CFUserCommand
impl StructuralPartialEq for CFUserCommand
Auto Trait Implementations§
impl Freeze for CFUserCommand
impl RefUnwindSafe for CFUserCommand
impl Send for CFUserCommand
impl Sync for CFUserCommand
impl Unpin for CFUserCommand
impl UnwindSafe for CFUserCommand
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.