pub trait ServerFnErrorSerde: Sized {
// Required methods
fn ser(&self) -> Result<String, Error>;
fn de(data: &str) -> Self;
}
Expand description
A serializable custom server function error type.
This is implemented for all types that implement FromStr
+ Display
.
This means you do not necessarily need the overhead of serde
for a custom error type.
Instead, you can use something like strum
to derive FromStr
and Display
for your
custom error type.
This is implemented for the default ServerFnError
, which uses NoCustomError
.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.