pub trait ApiError {
type Ok;
// Required methods
fn bad_request_from_error(self) -> Result<Self::Ok, Response<String>>;
fn bad_request(
self,
msg: impl AsRef<str>,
) -> Result<Self::Ok, Response<String>>;
fn not_found(
self,
msg: impl AsRef<str>,
) -> Result<Self::Ok, Response<String>>;
fn internal(
self,
msg: impl AsRef<str>,
) -> Result<Self::Ok, Response<String>>;
}
Required Associated Types§
Required Methods§
fn bad_request_from_error(self) -> Result<Self::Ok, Response<String>>
fn bad_request(self, msg: impl AsRef<str>) -> Result<Self::Ok, Response<String>>
fn not_found(self, msg: impl AsRef<str>) -> Result<Self::Ok, Response<String>>
fn internal(self, msg: impl AsRef<str>) -> Result<Self::Ok, Response<String>>
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.