pub struct ApiError {
pub code: RpcErrorCode,
pub message: String,
pub retryable: bool,
pub details: Option<Value>,
pub status: StatusCode,
pub request_id: String,
pub method: Option<String>,
}Fields§
§code: RpcErrorCode§message: String§retryable: bool§details: Option<Value>§status: StatusCode§request_id: String§method: Option<String>Implementations§
Source§impl ApiError
impl ApiError
pub fn new(code: RpcErrorCode, message: impl Into<String>) -> Self
pub fn with_context( self, request_id: impl Into<String>, method: Option<String>, ) -> Self
pub fn with_details(self, details: Value) -> Self
pub fn invalid_request(message: impl Into<String>) -> Self
pub fn method_not_found(method: impl Into<String>) -> Self
pub fn invalid_params(message: impl Into<String>) -> Self
pub fn forbidden(message: impl Into<String>) -> Self
pub fn conflict(message: impl Into<String>) -> Self
pub fn not_found(message: impl Into<String>) -> Self
pub fn precondition_failed(message: impl Into<String>) -> Self
pub fn task_not_found(message: impl Into<String>) -> Self
pub fn loop_not_found(message: impl Into<String>) -> Self
pub fn planning_session_not_found(message: impl Into<String>) -> Self
pub fn collection_not_found(message: impl Into<String>) -> Self
pub fn config_invalid(message: impl Into<String>) -> Self
pub fn idempotency_conflict(message: impl Into<String>) -> Self
pub fn internal(message: impl Into<String>) -> Self
pub fn as_body(&self) -> RpcErrorBody
Trait Implementations§
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