pub struct ApiError {
pub error: String,
pub code: String,
/* private fields */
}Fields§
§error: String§code: StringImplementations§
Source§impl ApiError
impl ApiError
pub fn validation(msg: impl Into<String>) -> Self
pub fn not_found(msg: impl Into<String>) -> Self
pub fn unknown_model(msg: impl Into<String>) -> Self
pub fn inference(msg: impl Into<String>) -> Self
pub fn internal(msg: impl Into<String>) -> Self
pub fn internal_with_status(msg: impl Into<String>, status: StatusCode) -> Self
pub fn with_code( msg: impl Into<String>, code: impl Into<String>, status: StatusCode, ) -> Self
pub fn queue_job_not_found(msg: impl Into<String>) -> Self
pub fn queue_job_running(msg: impl Into<String>) -> Self
Sourcepub fn cancelled(msg: impl Into<String>) -> Self
pub fn cancelled(msg: impl Into<String>) -> Self
Job cancelled while queued. 499 is the de-facto “client closed request” status (nginx); we reuse it for “request cancelled before the server did any work” so clients can distinguish cancellation from real inference failures.
pub fn insufficient_memory(msg: impl Into<String>) -> Self
pub fn forbidden(msg: impl Into<String>) -> Self
pub fn queue_full(msg: impl Into<String>) -> Self
Trait Implementations§
Source§impl IntoResponse for ApiError
impl IntoResponse for ApiError
Source§fn into_response(self) -> Response
fn into_response(self) -> Response
Create a response.
Auto Trait Implementations§
impl Freeze for ApiError
impl RefUnwindSafe for ApiError
impl Send for ApiError
impl Sync for ApiError
impl Unpin for ApiError
impl UnsafeUnpin for ApiError
impl UnwindSafe for ApiError
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more