Struct surf_disco::error::ClientError
pub struct ClientError {
pub status: StatusCode,
pub message: String,
}
Expand description
The simplest possible implementation of Error.
You can use this to get up and running quickly if you don’t want to create your own error type. However, we strongly reccommend creating a custom error type and implementing Error for it, so that you can provide more informative and structured error responses specific to your API.
Fields§
§status: StatusCode
§message: String
Trait Implementations§
§impl Clone for ServerError
impl Clone for ServerError
§fn clone(&self) -> ServerError
fn clone(&self) -> ServerError
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for ServerError
impl Debug for ServerError
§impl<'de> Deserialize<'de> for ServerError
impl<'de> Deserialize<'de> for ServerError
§fn deserialize<__D>(
__deserializer: __D
) -> Result<ServerError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ServerError, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Display for ServerError
impl Display for ServerError
§impl Error for ServerError
impl Error for ServerError
§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
§impl Error for ServerError
impl Error for ServerError
fn catch_all(status: StatusCode, message: String) -> ServerError
fn status(&self) -> StatusCode
fn from_io_error(source: Error) -> Self
fn from_config_error(source: ConfigError) -> Self
fn from_route_error<E>(source: RouteError<E>) -> Selfwhere
E: Display,
fn from_request_error(source: RequestError) -> Self
fn from_socket_error<E>(source: SocketError<E>) -> Selfwhere
E: Display,
fn into_tide_error(self) -> Error
fn from_server_error(source: Error) -> Self
§impl ErrorCompat for ServerError
impl ErrorCompat for ServerError
§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
Error::source
. Read more§impl From<ConfigError> for ServerError
impl From<ConfigError> for ServerError
§fn from(source: ConfigError) -> ServerError
fn from(source: ConfigError) -> ServerError
Converts to this type from the input type.
§impl From<Error> for ServerError
impl From<Error> for ServerError
§fn from(source: Error) -> ServerError
fn from(source: Error) -> ServerError
Converts to this type from the input type.
§impl From<RequestError> for ServerError
impl From<RequestError> for ServerError
§fn from(source: RequestError) -> ServerError
fn from(source: RequestError) -> ServerError
Converts to this type from the input type.
§impl<E> From<RouteError<E>> for ServerErrorwhere
E: Display,
impl<E> From<RouteError<E>> for ServerErrorwhere
E: Display,
§fn from(source: RouteError<E>) -> ServerError
fn from(source: RouteError<E>) -> ServerError
Converts to this type from the input type.
§impl<E> From<SocketError<E>> for ServerErrorwhere
E: Display,
impl<E> From<SocketError<E>> for ServerErrorwhere
E: Display,
§fn from(source: SocketError<E>) -> ServerError
fn from(source: SocketError<E>) -> ServerError
Converts to this type from the input type.
§impl PartialEq for ServerError
impl PartialEq for ServerError
§fn eq(&self, other: &ServerError) -> bool
fn eq(&self, other: &ServerError) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl Serialize for ServerError
impl Serialize for ServerError
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for ServerError
impl StructuralPartialEq for ServerError
Auto Trait Implementations§
impl Freeze for ServerError
impl RefUnwindSafe for ServerError
impl Send for ServerError
impl Sync for ServerError
impl Unpin for ServerError
impl UnwindSafe for ServerError
Blanket Implementations§
§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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