pub enum Error {
Http(Error),
Parse(Error),
CodeforcesApi(String),
Testcases(&'static str),
}Expand description
Error type for requests sent through this crate.
When sending a request is unsuccessful, a variant of the Error type
will be returned.
Variants§
Http(Error)
Http errors are a wrapper for network errors returned internally by
reqwest.
This could be returned if, for example, the device is not connected to
the internet. Further documentation can be found with the
reqwest::Error type.
Parse(Error)
Parse errors are a wrapper for parsing errors returned internally by
reqwest.
This could be returned if, for example, the Codeforces API returns
malformed JSON. Further documentation can be found with the
reqwest::Error type.
CodeforcesApi(String)
CodeforcesApi errors are returned when the Codeforces API returns a
status: FAILED response, the comment field of the response is returned
as a String
Testcases(&'static str)
Testcases errors are returned only when grabbing testcases which uses
webscraping internally since the Codeforces API does not provide it.
For now, a simple message (&'static str) is returned, outlining the
error. However, in future, this could/should be moved into its own enum.
Trait Implementations§
Source§impl Display for Error
Display the error with a short description of the error type as a prefix.
impl Display for Error
Display the error with a short description of the error type as a prefix.
Source§impl Error for Error
Standard error impl for custom error type.
impl Error for Error
Standard error impl for custom error type.