diff --git a/src/model/error_response.rs b/src/model/error_response.rs new file mode 100644 index 0000000..a1a6bd6 --- /dev/null +++ b/src/model/error_response.rs @@ -0,0 +1,19 @@ +//! A model for the error response. + +use serde::Deserialize; + +/// An error response. +#[derive(Clone, Debug, Deserialize)] +#[non_exhaustive] +pub struct ErrorResponse { + /// The error message. + /// + /// e.g. "No such user! | Either you mistyped something, or the account no longer exists." + pub msg: Option, +} + +impl AsRef for ErrorResponse { + fn as_ref(&self) -> &Self { + self + } +} diff --git a/src/model/mod.rs b/src/model/mod.rs index 90f6115..8e51b70 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -3,6 +3,7 @@ pub mod achievement; pub mod achievement_info; pub mod cache; +pub mod error_response; pub mod labs; pub mod leaderboard; pub mod league_rank;