pub struct ErrorTemplates { /* private fields */ }Expand description
Error templates manager
Implementations§
Source§impl ErrorTemplates
impl ErrorTemplates
Sourcepub fn set_template(&mut self, status_code: u16, template: ErrorTemplate)
pub fn set_template(&mut self, status_code: u16, template: ErrorTemplate)
Set custom template for a status code
Sourcepub fn set_template_file(&mut self, status_code: u16, path: impl Into<PathBuf>)
pub fn set_template_file(&mut self, status_code: u16, path: impl Into<PathBuf>)
Set custom template file for a status code
Sourcepub fn has_custom(&self, status_code: u16) -> bool
pub fn has_custom(&self, status_code: u16) -> bool
Check if custom template exists
Sourcepub fn custom_count(&self) -> usize
pub fn custom_count(&self) -> usize
Get count of custom templates
Trait Implementations§
Source§impl Clone for ErrorTemplates
impl Clone for ErrorTemplates
Source§fn clone(&self) -> ErrorTemplates
fn clone(&self) -> ErrorTemplates
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 moreSource§impl Debug for ErrorTemplates
impl Debug for ErrorTemplates
Auto Trait Implementations§
impl Freeze for ErrorTemplates
impl RefUnwindSafe for ErrorTemplates
impl Send for ErrorTemplates
impl Sync for ErrorTemplates
impl Unpin for ErrorTemplates
impl UnsafeUnpin for ErrorTemplates
impl UnwindSafe for ErrorTemplates
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