pub enum ServerError {
App(String),
Unauthorized(String),
Forbidden(String),
BadRequest(String),
Network(String),
}Expand description
All failures a client stub can return.
ServerError::Appis serialized by the server as part of aResult::Errand decoded verbatim on the client.ServerError::Networkis synthesized locally when the fetch never reached the server, or the body didn’t parse as JSON.
Variants§
App(String)
An application-level error produced on the server side.
Authentication is required but missing or invalid.
Forbidden(String)
Authentication succeeded, but this caller cannot perform the action.
BadRequest(String)
The request payload was malformed or exceeded the framework body limit.
Network(String)
Transport / deserialization failure on the client side.
Implementations§
Trait Implementations§
Source§impl Clone for ServerError
impl Clone for ServerError
Source§fn clone(&self) -> ServerError
fn clone(&self) -> ServerError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ServerError
impl Debug for ServerError
Source§impl<'de> Deserialize<'de> for ServerError
impl<'de> Deserialize<'de> for ServerError
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ServerError
impl Display for ServerError
Source§impl Error for ServerError
impl Error for ServerError
1.30.0 · 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<&str> for ServerError
impl From<&str> for ServerError
Source§impl From<ServerError> for LoaderError
impl From<ServerError> for LoaderError
Source§fn from(err: ServerError) -> Self
fn from(err: ServerError) -> Self
Converts to this type from the input type.
Source§impl From<String> for ServerError
impl From<String> 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 UnsafeUnpin for ServerError
impl UnwindSafe for ServerError
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