pub struct ErrorResponse {
pub message: String,
pub documentation_url: Option<String>,
pub errors: Option<Vec<ValidationError>>,
}Expand description
GitHub-compatible error response.
Fields§
§message: StringError message.
documentation_url: Option<String>Documentation URL.
errors: Option<Vec<ValidationError>>Validation errors (for 422 responses).
Implementations§
Source§impl ErrorResponse
impl ErrorResponse
Sourcepub fn with_docs(
message: impl Into<String>,
docs_url: impl Into<String>,
) -> Self
pub fn with_docs( message: impl Into<String>, docs_url: impl Into<String>, ) -> Self
Create an error with documentation URL.
Sourcepub fn validation(
message: impl Into<String>,
errors: Vec<ValidationError>,
) -> Self
pub fn validation( message: impl Into<String>, errors: Vec<ValidationError>, ) -> Self
Create a validation error response.
Sourcepub fn bad_credentials() -> Self
pub fn bad_credentials() -> Self
Standard “Bad credentials” error.
Sourcepub fn rate_limited(reset: u64) -> Self
pub fn rate_limited(reset: u64) -> Self
Standard rate limit error.
Trait Implementations§
Source§impl Clone for ErrorResponse
impl Clone for ErrorResponse
Source§fn clone(&self) -> ErrorResponse
fn clone(&self) -> ErrorResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ErrorResponse
impl Debug for ErrorResponse
Source§impl<'de> Deserialize<'de> for ErrorResponse
impl<'de> Deserialize<'de> for ErrorResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ErrorResponse
impl RefUnwindSafe for ErrorResponse
impl Send for ErrorResponse
impl Sync for ErrorResponse
impl Unpin for ErrorResponse
impl UnsafeUnpin for ErrorResponse
impl UnwindSafe for ErrorResponse
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
Mutably borrows from an owned value. Read more