#[non_exhaustive]pub enum Error {
Show 14 variants
Base64DecodeError(DecodeError),
BodyError(Box<dyn Error + Send + Sync>),
ConnectError(Box<ConnectError>),
InvalidRequest(String),
InvalidResponse(String),
InvalidMetadata(&'static str),
InvalidHeaderName(InvalidHeaderName),
InvalidHeaderValue(InvalidHeaderValue),
InvalidUri(InvalidUri),
InvalidUriParts(InvalidUriParts),
SerdeError(Error),
ProstEncodeError(EncodeError),
ProstDecodeError(DecodeError),
UnsupportedMessageCodec(String),
}Expand description
A general error type for Connect operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Base64DecodeError(DecodeError)
BodyError(Box<dyn Error + Send + Sync>)
ConnectError(Box<ConnectError>)
InvalidRequest(String)
InvalidResponse(String)
InvalidMetadata(&'static str)
InvalidHeaderName(InvalidHeaderName)
InvalidHeaderValue(InvalidHeaderValue)
InvalidUri(InvalidUri)
InvalidUriParts(InvalidUriParts)
SerdeError(Error)
ProstEncodeError(EncodeError)
ProstDecodeError(DecodeError)
UnsupportedMessageCodec(String)
Implementations§
Source§impl Error
impl Error
Sourcepub fn invalid_request(msg: impl Display) -> Self
pub fn invalid_request(msg: impl Display) -> Self
Create an invalid request error with the given message.
Sourcepub fn internal(message: impl Display) -> Error
pub fn internal(message: impl Display) -> Error
Create a not found error with the given message.
Sourcepub fn unsupported_media_type(msg: impl Display) -> Error
pub fn unsupported_media_type(msg: impl Display) -> Error
Create an unsupported media type error with the given message. This is typically used when the message codec is not supported by the server.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<DecodeError> for Error
impl From<DecodeError> for Error
Source§fn from(source: DecodeError) -> Self
fn from(source: DecodeError) -> Self
Converts to this type from the input type.
Source§impl From<EncodeError> for Error
impl From<EncodeError> for Error
Source§fn from(source: EncodeError) -> Self
fn from(source: EncodeError) -> Self
Converts to this type from the input type.
Source§impl From<Error> for ConnectError
impl From<Error> for ConnectError
Source§impl From<InvalidHeaderName> for Error
impl From<InvalidHeaderName> for Error
Source§fn from(source: InvalidHeaderName) -> Self
fn from(source: InvalidHeaderName) -> Self
Converts to this type from the input type.
Source§impl From<InvalidHeaderValue> for Error
impl From<InvalidHeaderValue> for Error
Source§fn from(source: InvalidHeaderValue) -> Self
fn from(source: InvalidHeaderValue) -> Self
Converts to this type from the input type.
Source§impl From<InvalidUri> for Error
impl From<InvalidUri> for Error
Source§fn from(source: InvalidUri) -> Self
fn from(source: InvalidUri) -> Self
Converts to this type from the input type.
Source§impl From<InvalidUriParts> for Error
impl From<InvalidUriParts> for Error
Source§fn from(source: InvalidUriParts) -> Self
fn from(source: InvalidUriParts) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl !RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl !UnwindSafe for Error
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