Enum ServerFnError
pub enum ServerFnError<E = NoCustomError> {
WrappedServerError(E),
Registration(String),
Request(String),
Response(String),
ServerError(String),
MiddlewareError(String),
Deserialization(String),
Serialization(String),
Args(String),
MissingArg(String),
}
Expand description
A type that can be used as the return type of the server function for easy error conversion with ?
operator.
This type can be replaced with any other error type that implements FromServerFnError
.
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.
MiddlewareError(String)
Occurs when there is an error while actually running the middleware 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§
§impl ServerFnError
impl ServerFnError
pub fn new(msg: impl ToString) -> ServerFnError
pub fn new(msg: impl ToString) -> ServerFnError
Constructs a new ServerFnError::ServerError
from some other type.
Trait Implementations§
§impl<E> Clone for ServerFnError<E>where
E: Clone,
impl<E> Clone for ServerFnError<E>where
E: Clone,
§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 more§impl<E> Debug for ServerFnError<E>where
E: Debug,
impl<E> Debug for ServerFnError<E>where
E: Debug,
§impl<CustErr> Decodes<ServerFnError<CustErr>> for ServerFnErrorEncodingwhere
CustErr: FromStr,
impl<CustErr> Decodes<ServerFnError<CustErr>> for ServerFnErrorEncodingwhere
CustErr: FromStr,
§fn decode(
bytes: Bytes,
) -> Result<ServerFnError<CustErr>, <ServerFnErrorEncoding as Decodes<ServerFnError<CustErr>>>::Error>
fn decode( bytes: Bytes, ) -> Result<ServerFnError<CustErr>, <ServerFnErrorEncoding as Decodes<ServerFnError<CustErr>>>::Error>
§impl<'de, E> Deserialize<'de> for ServerFnError<E>where
E: Deserialize<'de>,
impl<'de, E> Deserialize<'de> for ServerFnError<E>where
E: Deserialize<'de>,
§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>,
§impl<CustErr> Display for ServerFnError<CustErr>where
CustErr: Display,
impl<CustErr> Display for ServerFnError<CustErr>where
CustErr: Display,
§impl<CustErr> Encodes<ServerFnError<CustErr>> for ServerFnErrorEncodingwhere
CustErr: Display,
impl<CustErr> Encodes<ServerFnError<CustErr>> for ServerFnErrorEncodingwhere
CustErr: Display,
§fn encode(
output: &ServerFnError<CustErr>,
) -> Result<Bytes, <ServerFnErrorEncoding as Encodes<ServerFnError<CustErr>>>::Error>
fn encode( output: &ServerFnError<CustErr>, ) -> Result<Bytes, <ServerFnErrorEncoding as Encodes<ServerFnError<CustErr>>>::Error>
§impl<E> Error for ServerFnError<E>
impl<E> Error for ServerFnError<E>
§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
§impl<CustErr> From<CustErr> for ServerFnError<CustErr>
impl<CustErr> From<CustErr> for ServerFnError<CustErr>
§fn from(value: CustErr) -> ServerFnError<CustErr>
fn from(value: CustErr) -> ServerFnError<CustErr>
§impl<E> From<E> for ServerFnErrorwhere
E: Error,
impl<E> From<E> for ServerFnErrorwhere
E: Error,
§fn from(value: E) -> ServerFnError
fn from(value: E) -> ServerFnError
§impl From<ServerFnError> for Error
impl From<ServerFnError> for Error
§fn from(e: ServerFnError) -> Error
fn from(e: ServerFnError) -> Error
§impl<E> From<ServerFnUrlError<E>> for ServerFnError<E>
impl<E> From<ServerFnUrlError<E>> for ServerFnError<E>
§fn from(error: ServerFnUrlError<E>) -> ServerFnError<E>
fn from(error: ServerFnUrlError<E>) -> ServerFnError<E>
§impl<E> From<ServerFnUrlError<ServerFnError<E>>> for ServerFnError<E>
impl<E> From<ServerFnUrlError<ServerFnError<E>>> for ServerFnError<E>
§fn from(error: ServerFnUrlError<ServerFnError<E>>) -> ServerFnError<E>
fn from(error: ServerFnUrlError<ServerFnError<E>>) -> ServerFnError<E>
§impl<CustErr> FromServerFnError for ServerFnError<CustErr>
impl<CustErr> FromServerFnError for ServerFnError<CustErr>
§type Encoder = ServerFnErrorEncoding
type Encoder = ServerFnErrorEncoding
Encodes
trait for references to the error type.§fn from_server_fn_error(value: ServerFnErrorErr) -> ServerFnError<CustErr>
fn from_server_fn_error(value: ServerFnErrorErr) -> ServerFnError<CustErr>
ServerFnErrorErr
into the application-specific custom error type.§impl<E> PartialEq for ServerFnError<E>where
E: PartialEq,
impl<E> PartialEq for ServerFnError<E>where
E: PartialEq,
§impl<E> Serialize for ServerFnError<E>where
E: Serialize,
impl<E> Serialize for ServerFnError<E>where
E: Serialize,
§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,
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<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§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, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Source§fn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Source§impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Source§fn arrays_into(self) -> C
fn arrays_into(self) -> C
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Source§type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters
when converting.Source§fn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Source§fn components_from(colors: C) -> T
fn components_from(colors: C) -> T
§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
§fn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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
§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
key
and return true
if they are equal.Source§impl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Source§fn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.§impl<T> FromFormData for Twhere
T: DeserializeOwned,
impl<T> FromFormData for Twhere
T: DeserializeOwned,
§fn from_event(ev: &Event) -> Result<T, FromFormDataError>
fn from_event(ev: &Event) -> Result<T, FromFormDataError>
submit
event.§fn from_form_data(form_data: &FormData) -> Result<T, Error>
fn from_form_data(form_data: &FormData) -> Result<T, Error>
§impl<E, T, Request> FromReq<StreamingText, Request, E> for T
impl<E, T, Request> FromReq<StreamingText, Request, E> for T
Source§impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Source§fn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.§impl<S, T> FromStream<T> for S
impl<S, T> FromStream<T> for S
§fn from_stream(stream: impl Stream<Item = T> + Send + 'static) -> S
fn from_stream(stream: impl Stream<Item = T> + Send + 'static) -> S
§fn from_stream_unsync(stream: impl Stream<Item = T> + 'static) -> S
fn from_stream_unsync(stream: impl Stream<Item = T> + 'static) -> S
Source§impl<T> Hexable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
impl<T> Hexable for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
impl<E> InstrumentError for Ewhere
TracedError<E>: From<E>,
§type Instrumented = TracedError<E>
type Instrumented = TracedError<E>
§fn in_current_span(self) -> <E as InstrumentError>::Instrumented
fn in_current_span(self) -> <E as InstrumentError>::Instrumented
Source§impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Source§fn into_angle(self) -> U
fn into_angle(self) -> U
T
.Source§impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Source§type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters
when converting.Source§fn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.Source§impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Source§fn into_color(self) -> U
fn into_color(self) -> U
Source§impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Source§fn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
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> ⓘ
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> ⓘ
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 moreSource§impl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Source§fn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Pointee for T
impl<T> Pointee for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> SerializableKey for T
impl<T> SerializableKey for T
§impl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
§fn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
§fn into_taken(self) -> T
fn into_taken(self) -> T
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.
Source§impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Source§type Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.Source§fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
Source§impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Source§fn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read more