pub enum KodeBridgeError {
Show 18 variants
Io(Error),
Json(Error),
HttpParse(Error),
Http(Error),
InvalidStatusCode(InvalidStatusCode),
Utf8(Utf8Error),
FromUtf8(FromUtf8Error),
Connection {
message: String,
},
Timeout {
duration_ms: u64,
},
Protocol {
message: String,
},
Configuration {
message: String,
},
InvalidRequest {
message: String,
},
ServerError {
status: u16,
},
ClientError {
status: u16,
},
StreamClosed,
JsonSerialize {
message: String,
},
PoolExhausted,
Custom {
message: String,
},
}Expand description
Comprehensive error types for kode-bridge
Variants§
Io(Error)
Json(Error)
HttpParse(Error)
Http(Error)
InvalidStatusCode(InvalidStatusCode)
Utf8(Utf8Error)
FromUtf8(FromUtf8Error)
Connection
Timeout
Protocol
Configuration
InvalidRequest
ServerError
ClientError
StreamClosed
JsonSerialize
PoolExhausted
Custom
Implementations§
Source§impl KodeBridgeError
impl KodeBridgeError
pub fn connection<S: Into<String>>(message: S) -> Self
pub const fn timeout(duration_ms: u64) -> Self
pub fn timeout_msg<S: Into<String>>(_message: S) -> Self
pub fn protocol<S: Into<String>>(message: S) -> Self
pub fn configuration<S: Into<String>>(message: S) -> Self
pub fn invalid_request<S: Into<String>>(message: S) -> Self
pub fn custom<S: Into<String>>(message: S) -> Self
pub fn json_serialize<S: Into<String>>(message: S) -> Self
pub fn json_parse<S: Into<String>>(message: S) -> Self
pub fn validation<S: Into<String>>(message: S) -> Self
Sourcepub const fn is_retriable(&self) -> bool
pub const fn is_retriable(&self) -> bool
Check if error is retriable
Sourcepub const fn is_client_error(&self) -> bool
pub const fn is_client_error(&self) -> bool
Check if error is a client error
Sourcepub const fn is_server_error(&self) -> bool
pub const fn is_server_error(&self) -> bool
Check if error is a server error
Trait Implementations§
Source§impl Debug for KodeBridgeError
impl Debug for KodeBridgeError
Source§impl Display for KodeBridgeError
impl Display for KodeBridgeError
Source§impl Error for KodeBridgeError
impl Error for KodeBridgeError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<Box<dyn Error + Send + Sync>> for KodeBridgeError
Convert AnyError to KodeBridgeError
impl From<Box<dyn Error + Send + Sync>> for KodeBridgeError
Convert AnyError to KodeBridgeError
Source§impl From<Error> for KodeBridgeError
impl From<Error> for KodeBridgeError
Source§impl From<Error> for KodeBridgeError
impl From<Error> for KodeBridgeError
Source§impl From<Error> for KodeBridgeError
impl From<Error> for KodeBridgeError
Source§impl From<Error> for KodeBridgeError
impl From<Error> for KodeBridgeError
Source§impl From<FromUtf8Error> for KodeBridgeError
impl From<FromUtf8Error> for KodeBridgeError
Source§fn from(source: FromUtf8Error) -> Self
fn from(source: FromUtf8Error) -> Self
Converts to this type from the input type.
Source§impl From<InvalidStatusCode> for KodeBridgeError
impl From<InvalidStatusCode> for KodeBridgeError
Source§fn from(source: InvalidStatusCode) -> Self
fn from(source: InvalidStatusCode) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for KodeBridgeError
impl !RefUnwindSafe for KodeBridgeError
impl Send for KodeBridgeError
impl Sync for KodeBridgeError
impl Unpin for KodeBridgeError
impl UnsafeUnpin for KodeBridgeError
impl !UnwindSafe for KodeBridgeError
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