Type Alias Result
Source pub type Result<T, E = Error> = Result<T, E>;
Expand description
Result with Error as the default error type, returned by Ocre APIs and handlers.
§Examples
fn parse_id(text: &str) -> ocre::Result<i64> {
text.parse().map_err(|_| ocre::Error::bad_request("id must be a number"))
}
assert_eq!(parse_id("7").unwrap(), 7);
assert!(parse_id("x").is_err());
pub enum Result<T, E = Error> {
Ok(T),
Err(E),
}
Contains the success value