pub struct DirectError { /* private fields */ }Expand description
What the interpretation itself answers when no handler can be reached.
A domain states its own failures; these are the ones routing and reading a request produce.
Implementations§
Source§impl DirectError
impl DirectError
Sourcepub fn new(status: HttpStatus, message: impl Into<String>) -> DirectError
pub fn new(status: HttpStatus, message: impl Into<String>) -> DirectError
States a failure with the status it is answered with.
Sourcepub fn not_found(path: &str) -> DirectError
pub fn not_found(path: &str) -> DirectError
States that nothing is declared at a path.
Sourcepub fn method_not_allowed(path: &str) -> DirectError
pub fn method_not_allowed(path: &str) -> DirectError
States that something is declared at a path, but not under this method.
Sourcepub fn unreadable(role: &str, reason: &str) -> DirectError
pub fn unreadable(role: &str, reason: &str) -> DirectError
States that an argument could not be read from where its role says it comes from.
Trait Implementations§
Source§impl Clone for DirectError
impl Clone for DirectError
Source§fn clone(&self) -> DirectError
fn clone(&self) -> DirectError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DirectError
impl Debug for DirectError
Source§impl Display for DirectError
impl Display for DirectError
impl Eq for DirectError
Source§impl Error for DirectError
impl Error for DirectError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl From<DirectError> for DirectResponse
impl From<DirectError> for DirectResponse
Source§fn from(error: DirectError) -> DirectResponse
fn from(error: DirectError) -> DirectResponse
Converts to this type from the input type.
Source§impl HttpErrorAlg for DirectError
impl HttpErrorAlg for DirectError
Source§const HTTP_STATUSES: &'static [HttpStatus]
const HTTP_STATUSES: &'static [HttpStatus]
Every status this failure can be answered with. Read more
Source§fn http_status(&self) -> HttpStatus
fn http_status(&self) -> HttpStatus
Returns the status this failure is answered with.
Source§fn http_message(&self) -> String
fn http_message(&self) -> String
Returns the message this failure is answered with.
Source§impl PartialEq for DirectError
impl PartialEq for DirectError
impl StructuralPartialEq for DirectError
Auto Trait Implementations§
impl Freeze for DirectError
impl RefUnwindSafe for DirectError
impl Send for DirectError
impl Sync for DirectError
impl Unpin for DirectError
impl UnsafeUnpin for DirectError
impl UnwindSafe for DirectError
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<This> HttpProgramExt<This> for This
impl<This> HttpProgramExt<This> for This
Source§fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
fn compile_http<Program>(
&self,
program: Program,
) -> <Program as HttpProgramAlg<This>>::Routewhere
Program: HttpProgramAlg<This>,
Compiles a named HTTP program with this interpreter.