Enum codeforces_api::responses::CFResult[][src]

pub enum CFResult {
    CFCommentVec(Vec<CFComment>),
    CFBlogEntry(CFBlogEntry),
    CFHackVec(Vec<CFHack>),
    CFContestVec(Vec<CFContest>),
    CFRatingChangeVec(Vec<CFRatingChange>),
    CFContestStandings(CFContestStandings),
    CFSubmissionVec(Vec<CFSubmission>),
    CFProblemset(CFProblemset),
    CFRecentActionVec(Vec<CFRecentAction>),
    CFBlogEntryVec(Vec<CFBlogEntry>),
    CFFriends(Vec<String>),
    CFUserVec(Vec<CFUser>),
}

Wrapper for all forms of result returned by the Codeforces API.

Examples

You probably want to match on it depending on the kind of request you are making.

let x = CFContestCommand::Status {
    contest_id: 1485,
    handle: None,
    from: Some(1),
    count: Some(3),
};
 
// x.get(..) will return a CFResult type. You should match on it to make
// sure that it returned the type you expected.
// To check which type a request should return, you can check its docs.
// If the type returned is of the form `Ok(<unexpected_type>)`, then an
// internal parsing issue has occurred somewhere (this should be rare).
if let Ok(CFResult::CFSubmissionVec(v)) = x.get(api_key, api_secret) {
    // your code here
}

Variants

CFCommentVec(Vec<CFComment>)
CFBlogEntry(CFBlogEntry)
CFHackVec(Vec<CFHack>)
CFContestVec(Vec<CFContest>)
CFRatingChangeVec(Vec<CFRatingChange>)
CFContestStandings(CFContestStandings)
CFSubmissionVec(Vec<CFSubmission>)
CFProblemset(CFProblemset)
CFRecentActionVec(Vec<CFRecentAction>)
CFBlogEntryVec(Vec<CFBlogEntry>)
CFFriends(Vec<String>)
CFUserVec(Vec<CFUser>)

Trait Implementations

impl Clone for CFResult[src]

impl Debug for CFResult[src]

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

impl Display for CFResult[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Display type as yaml using serde_yaml.

impl PartialEq<CFResult> for CFResult[src]

impl Serialize for CFResult[src]

impl StructuralPartialEq for CFResult[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<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> 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> ToString for T where
    T: Display + ?Sized
[src]

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