pub struct ErrorPages { /* private fields */ }
Expand description
Error page configuration and rendering
Implementations§
Source§impl ErrorPages
impl ErrorPages
Sourcepub fn without_default_styling(self) -> Self
pub fn without_default_styling(self) -> Self
Disable default styling (use plain HTML)
Sourcepub fn custom_page(self, status_code: u16, html: String) -> Self
pub fn custom_page(self, status_code: u16, html: String) -> Self
Set a custom error page for a specific status code
Sourcepub fn custom_404(self, html: String) -> Self
pub fn custom_404(self, html: String) -> Self
Set a custom 404 page
Sourcepub fn custom_500(self, html: String) -> Self
pub fn custom_500(self, html: String) -> Self
Set a custom 500 page
Sourcepub fn random_404_message() -> &'static str
pub fn random_404_message() -> &'static str
Get a random fun 404 message (Sinatra-inspired with Torch flair)
Trait Implementations§
Source§impl Clone for ErrorPages
impl Clone for ErrorPages
Source§fn clone(&self) -> ErrorPages
fn clone(&self) -> ErrorPages
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ErrorPages
impl RefUnwindSafe for ErrorPages
impl Send for ErrorPages
impl Sync for ErrorPages
impl Unpin for ErrorPages
impl UnwindSafe for ErrorPages
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