pub enum ErrorCode {
Show 64 variants
RuntimeInvalidValue,
RuntimeInvalidIndex,
RuntimeInvalidKey,
RuntimeNotImplemented,
HttpBadRequest,
HttpUnauthorized,
HttpPaymentRequired,
HttpForbidden,
HttpNotFound,
HttpMethodNotAllowed,
HttpNotAcceptable,
HttpProxyAuthenticationRequired,
HttpRequestTimeout,
HttpConflict,
HttpGone,
HttpLengthRequired,
HttpPreconditionFailed,
HttpPayloadTooLarge,
HttpUriTooLong,
HttpUnsupportedMediaType,
HttpRangeNotSatisfiable,
HttpExpectationFailed,
HttpImATeapot,
HttpMisdirectedRequest,
HttpUnprocessableEntity,
HttpLocked,
HttpFailedDependency,
HttpTooEarly,
HttpUpgradeRequired,
HttpPreconditionRequired,
HttpTooManyRequests,
HttpRequestHeaderFieldsTooLarge,
HttpUnavailableForLegalReasons,
HttpInternalServerError,
HttpNotImplemented,
HttpBadGateway,
HttpServiceUnavailable,
HttpGatewayTimeout,
HttpHttpVersionNotSupported,
HttpVariantAlsoNegotiates,
HttpInsufficientStorage,
HttpLoopDetected,
HttpNotExtended,
HttpNetworkAuthenticationRequired,
IoNotFound,
IoPermissionDenied,
IoConnectionRefused,
IoConnectionReset,
IoConnectionAborted,
IoNotConnected,
IoAddrInUse,
IoAddrNotAvailable,
IoBrokenPipe,
IoAlreadyExists,
IoWouldBlock,
IoInvalidInput,
IoInvalidData,
IoTimedOut,
IoWriteZero,
IoInterrupted,
IoUnsupported,
IoUnexpectedEof,
IoOutOfMemory,
IoOther,
}
Expand description
Error handling codes.
Provides runtime information that the caller can use to bypass faulty resources or reformulate an operation.
Variants§
RuntimeInvalidValue
RuntimeInvalidIndex
RuntimeInvalidKey
RuntimeNotImplemented
HttpBadRequest
HttpPaymentRequired
HttpForbidden
HttpNotFound
HttpMethodNotAllowed
HttpNotAcceptable
HttpProxyAuthenticationRequired
HttpRequestTimeout
HttpConflict
HttpGone
HttpLengthRequired
HttpPreconditionFailed
HttpPayloadTooLarge
HttpUriTooLong
HttpUnsupportedMediaType
HttpRangeNotSatisfiable
HttpExpectationFailed
HttpImATeapot
HttpMisdirectedRequest
HttpUnprocessableEntity
HttpLocked
HttpFailedDependency
HttpTooEarly
HttpUpgradeRequired
HttpPreconditionRequired
HttpTooManyRequests
HttpRequestHeaderFieldsTooLarge
HttpInternalServerError
HttpNotImplemented
HttpBadGateway
HttpGatewayTimeout
HttpHttpVersionNotSupported
HttpVariantAlsoNegotiates
HttpInsufficientStorage
HttpLoopDetected
HttpNotExtended
HttpNetworkAuthenticationRequired
IoNotFound
IoPermissionDenied
IoConnectionRefused
IoConnectionReset
IoConnectionAborted
IoNotConnected
IoAddrInUse
IoAddrNotAvailable
IoBrokenPipe
IoAlreadyExists
IoWouldBlock
IoInvalidInput
IoInvalidData
IoTimedOut
IoWriteZero
IoInterrupted
IoUnsupported
IoUnexpectedEof
IoOutOfMemory
IoOther
Implementations§
Source§impl ErrorCode
impl ErrorCode
Sourcepub fn from_http_value(value: u16) -> Option<Self>
pub fn from_http_value(value: u16) -> Option<Self>
Construct from an HTTP error code value.
Sourcepub fn to_http_value(code: ErrorCode) -> Option<u16>
pub fn to_http_value(code: ErrorCode) -> Option<u16>
Convert to its corresponding HTTP value, if any.
Sourcepub fn from_io_kind(kind: ErrorKind) -> Option<Self>
pub fn from_io_kind(kind: ErrorKind) -> Option<Self>
Construct from an IO error kind.
Sourcepub fn to_io_kind(self) -> Option<ErrorKind>
pub fn to_io_kind(self) -> Option<ErrorKind>
Convert to its corresponding std::io::ErrorKind
, if any.
Trait Implementations§
Source§impl ErrorStacks<ErrorCode> for StackError
impl ErrorStacks<ErrorCode> for StackError
Source§fn with_err_code(self, code: ErrorCode) -> Self
fn with_err_code(self, code: ErrorCode) -> Self
Set the error code.
Source§fn with_no_err_code(self) -> Self
fn with_no_err_code(self) -> Self
Remove the error code.
Source§fn with_err_uri(self, uri: String) -> Self
fn with_err_uri(self, uri: String) -> Self
Set the error URI.
Source§fn with_no_err_uri(self) -> Self
fn with_no_err_uri(self) -> Self
Remove the error URI.
Source§fn with_err_msg(self, message: impl Display + Send + Sync + 'static) -> Self
fn with_err_msg(self, message: impl Display + Send + Sync + 'static) -> Self
Set the error message.
Source§fn with_no_err_msg(self) -> Self
fn with_no_err_msg(self) -> Self
Remove the error message.
impl Copy for ErrorCode
impl Eq for ErrorCode
impl StructuralPartialEq for ErrorCode
Auto Trait Implementations§
impl Freeze for ErrorCode
impl RefUnwindSafe for ErrorCode
impl Send for ErrorCode
impl Sync for ErrorCode
impl Unpin for ErrorCode
impl UnwindSafe for ErrorCode
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