Enum server_fn::error::ServerFnError
source · 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<NoCustomError>
impl ServerFnError<NoCustomError>
sourcepub fn new(msg: impl ToString) -> Self
pub fn new(msg: impl ToString) -> Self
Constructs a new ServerFnError::ServerError
from some other type.
Trait Implementations§
source§impl<E> Archive for ServerFnError<E>
impl<E> Archive for ServerFnError<E>
source§type Archived = ArchivedServerFnError<E>
type Archived = ArchivedServerFnError<E>
source§type Resolver = ServerFnErrorResolver<E>
type Resolver = ServerFnErrorResolver<E>
source§impl<E: Clone> Clone for ServerFnError<E>
impl<E: Clone> Clone for ServerFnError<E>
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> Debug for ServerFnError<E>
impl<E: Debug> Debug for ServerFnError<E>
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl<__D: Fallible + ?Sized, E> Deserialize<ServerFnError<E>, __D> for Archived<ServerFnError<E>>where
E: Archive,
Archived<E>: Deserialize<E, __D>,
String: Archive,
Archived<String>: Deserialize<String, __D>,
impl<__D: Fallible + ?Sized, E> Deserialize<ServerFnError<E>, __D> for Archived<ServerFnError<E>>where
E: Archive,
Archived<E>: Deserialize<E, __D>,
String: Archive,
Archived<String>: Deserialize<String, __D>,
source§fn deserialize(
&self,
deserializer: &mut __D,
) -> Result<ServerFnError<E>, __D::Error>
fn deserialize( &self, deserializer: &mut __D, ) -> Result<ServerFnError<E>, __D::Error>
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§impl<E: Error> From<E> for ServerFnError
impl<E: Error> From<E> for ServerFnError
source§impl<CustErr> From<ServerFnError<CustErr>> for ServerFnErrorErr<CustErr>
impl<CustErr> From<ServerFnError<CustErr>> for ServerFnErrorErr<CustErr>
source§fn from(value: ServerFnError<CustErr>) -> Self
fn from(value: ServerFnError<CustErr>) -> Self
source§impl From<ServerFnError> for Error
impl From<ServerFnError> for Error
source§fn from(e: ServerFnError) -> Self
fn from(e: ServerFnError) -> Self
source§impl<CustErr> From<ServerFnUrlError<CustErr>> for ServerFnError<CustErr>
impl<CustErr> From<ServerFnUrlError<CustErr>> for ServerFnError<CustErr>
source§fn from(error: ServerFnUrlError<CustErr>) -> Self
fn from(error: ServerFnUrlError<CustErr>) -> Self
source§impl<E: PartialEq> PartialEq for ServerFnError<E>
impl<E: PartialEq> PartialEq for ServerFnError<E>
source§impl<E> Serialize for ServerFnError<E>where
E: Serialize,
impl<E> Serialize for ServerFnError<E>where
E: Serialize,
source§impl<CustErr> ServerFnErrorSerde for ServerFnError<CustErr>
impl<CustErr> ServerFnErrorSerde for ServerFnError<CustErr>
impl<E: Eq> Eq for ServerFnError<E>
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> ArchivePointee for T
impl<T> ArchivePointee for T
source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive
, it may be unsized. Read moresource§type MetadataResolver = ()
type MetadataResolver = ()
source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata,
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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.