#[non_exhaustive]pub struct ErrorPage<'a> {
pub status: u16,
pub title: &'a str,
pub message: &'a str,
pub reference: &'a str,
}Expand description
What an error page shows: the status, its generic title and message, and the request’s reference. Never the code or the cause.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.status: u16The status (404).
title: &'a strIts generic title (Not Found).
message: &'a strIts generic message.
reference: &'a strThe request’s reference, as the visitor quotes it.
Implementations§
Source§impl<'a> ErrorPage<'a>
impl<'a> ErrorPage<'a>
Sourcepub const fn new(
status: u16,
title: &'a str,
message: &'a str,
reference: &'a str,
) -> Self
pub const fn new( status: u16, title: &'a str, message: &'a str, reference: &'a str, ) -> Self
An error page’s facts, for an engine’s own tests (web-net makes the real ones).
let p = web_net::ErrorPage::new(404, "Not Found", "The page was not found.", "1a-2");
assert_eq!((p.status, p.reference), (404, "1a-2"));Trait Implementations§
impl<'a> Copy for ErrorPage<'a>
impl<'a> Eq for ErrorPage<'a>
impl<'a> StructuralPartialEq for ErrorPage<'a>
Auto Trait Implementations§
impl<'a> Forget for ErrorPage<'a>
impl<'a> Freeze for ErrorPage<'a>
impl<'a> RefUnwindSafe for ErrorPage<'a>
impl<'a> Send for ErrorPage<'a>
impl<'a> Sync for ErrorPage<'a>
impl<'a> Unpin for ErrorPage<'a>
impl<'a> UnsafeUnpin for ErrorPage<'a>
impl<'a> UnwindSafe for ErrorPage<'a>
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