pub struct AppError {
pub status: StatusCode,
pub code: &'static str,
pub message: String,
pub retry_after: Option<u64>,
}Expand description
A request failure, answered with a status and a shared::ApiError body.
Fields§
§status: StatusCode§code: &'static str§message: String§retry_after: Option<u64>Seconds for a Retry-After header (429).
Implementations§
Source§impl AppError
impl AppError
Sourcepub fn invalid_key() -> Self
pub fn invalid_key() -> Self
/whoami without a live key: the code of unauthorized, worded for the key itself.
pub fn not_found() -> Self
The file on disk differs from what the manifest promises, almost always a package being replaced mid-publish, so the client should retry.
Sourcepub fn rate_limited(retry_after: u64) -> Self
pub fn rate_limited(retry_after: u64) -> Self
Too many conflict reports from this client, or overall.
Sourcepub fn invalid_report(reason: &'static str) -> Self
pub fn invalid_report(reason: &'static str) -> Self
A report that failed validation, with a reason that never echoes the request.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppError
impl RefUnwindSafe for AppError
impl Send for AppError
impl Sync for AppError
impl Unpin for AppError
impl UnsafeUnpin for AppError
impl UnwindSafe for AppError
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