pub enum ServerFnError<E = NoCustomError> {
WrappedServerError(E),
Registration(String),
Request(String),
Response(String),
ServerError(String),
Deserialization(String),
Serialization(String),
Args(String),
MissingArg(String),
}
Expand description
Type for errors that can occur when using server functions.
Unlike ServerFnErrorErr
, this does not implement Error
.
This means that other error types can easily be converted into it using the
?
operator.
Variants§
WrappedServerError(E)
A user-defined custom error type, which defaults to NoCustomError
.
Registration(String)
Error while trying to register the server function (only occurs in case of poisoned RwLock).
Request(String)
Occurs on the client if there is a network error while trying to run function on server.
Response(String)
Occurs on the server if there is an error creating an HTTP response.
ServerError(String)
Occurs when there is an error while actually running the function on the server.
Deserialization(String)
Occurs on the client if there is an error deserializing the server’s response.
Serialization(String)
Occurs on the client if there is an error serializing the server function arguments.
Args(String)
Occurs on the server if there is an error deserializing one of the arguments that’s been sent.
MissingArg(String)
Occurs on the server if there’s a missing argument.
Implementations§
Source§impl ServerFnError
impl ServerFnError
Sourcepub fn new(msg: impl ToString) -> ServerFnError
pub fn new(msg: impl ToString) -> ServerFnError
Constructs a new ServerFnError::ServerError
from some other type.
Trait Implementations§
Source§impl<E> Clone for ServerFnError<E>where
E: Clone,
impl<E> Clone for ServerFnError<E>where
E: Clone,
Source§fn clone(&self) -> ServerFnError<E>
fn clone(&self) -> ServerFnError<E>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<E> Debug for ServerFnError<E>where
E: Debug,
impl<E> Debug for ServerFnError<E>where
E: Debug,
Source§impl<'de, E> Deserialize<'de> for ServerFnError<E>where
E: Deserialize<'de>,
impl<'de, E> Deserialize<'de> for ServerFnError<E>where
E: Deserialize<'de>,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServerFnError<E>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ServerFnError<E>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl<CustErr> Display for ServerFnError<CustErr>where
CustErr: Display,
impl<CustErr> Display for ServerFnError<CustErr>where
CustErr: Display,
Source§impl<E> Error for ServerFnError<E>
impl<E> Error for ServerFnError<E>
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl<CustErr> From<CustErr> for ServerFnError<CustErr>
impl<CustErr> From<CustErr> for ServerFnError<CustErr>
Source§fn from(value: CustErr) -> ServerFnError<CustErr>
fn from(value: CustErr) -> ServerFnError<CustErr>
Source§impl<E> From<E> for ServerFnErrorwhere
E: Error,
impl<E> From<E> for ServerFnErrorwhere
E: Error,
Source§fn from(value: E) -> ServerFnError
fn from(value: E) -> ServerFnError
Source§impl<CustErr> From<ServerFnUrlError<CustErr>> for ServerFnError<CustErr>
impl<CustErr> From<ServerFnUrlError<CustErr>> for ServerFnError<CustErr>
Source§fn from(error: ServerFnUrlError<CustErr>) -> ServerFnError<CustErr>
fn from(error: ServerFnUrlError<CustErr>) -> ServerFnError<CustErr>
Source§impl<E> PartialEq for ServerFnError<E>where
E: PartialEq,
impl<E> PartialEq for ServerFnError<E>where
E: PartialEq,
Source§impl<E> Serialize for ServerFnError<E>where
E: Serialize,
impl<E> Serialize for ServerFnError<E>where
E: Serialize,
Source§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,
Source§impl<CustErr> ServerFnErrorSerde for ServerFnError<CustErr>
impl<CustErr> ServerFnErrorSerde for ServerFnError<CustErr>
impl<E> Eq for ServerFnError<E>where
E: Eq,
impl<E> StructuralPartialEq for ServerFnError<E>
Auto Trait Implementations§
impl<E> Freeze for ServerFnError<E>where
E: Freeze,
impl<E> RefUnwindSafe for ServerFnError<E>where
E: RefUnwindSafe,
impl<E> Send for ServerFnError<E>where
E: Send,
impl<E> Sync for ServerFnError<E>where
E: Sync,
impl<E> Unpin for ServerFnError<E>where
E: Unpin,
impl<E> UnwindSafe for ServerFnError<E>where
E: UnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.