#[non_exhaustive]pub struct ServeError {
pub template: String,
pub message: String,
/* private fields */
}Available on crate feature
served only.Expand description
Why a template could not be rendered or written, naming the template.
Display prints template: message.
A file that could not be written keeps its io::ErrorKind, which
Self::io_failure returns. So a caller can treat a refused permission
apart from a full disk. A field can join this type in a minor release.
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.template: StringThe template, as the caller named it. A write error names the target path instead.
message: StringWhat went wrong, in words a user can act on.
Implementations§
Source§impl ServeError
impl ServeError
Sourcepub const fn io_failure(&self) -> Option<ErrorKind>
pub const fn io_failure(&self) -> Option<ErrorKind>
The I/O failure when the file or a directory above it could not be
written or resolved, such as
io::ErrorKind::PermissionDenied. None for a template that did not
render or declared a target it may not write.
Trait Implementations§
Source§impl Clone for ServeError
impl Clone for ServeError
Source§impl Debug for ServeError
impl Debug for ServeError
Source§impl Display for ServeError
impl Display for ServeError
impl Eq for ServeError
Source§impl Error for ServeError
impl Error for ServeError
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 PartialEq for ServeError
impl PartialEq for ServeError
impl StructuralPartialEq for ServeError
Auto Trait Implementations§
impl Forget for ServeError
impl Freeze for ServeError
impl RefUnwindSafe for ServeError
impl Send for ServeError
impl Sync for ServeError
impl Unpin for ServeError
impl UnsafeUnpin for ServeError
impl UnwindSafe for ServeError
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<T, O> Matches<O> for Twhere
T: PartialEq<O>,
impl<T, O> Matches<O> for Twhere
T: PartialEq<O>,
fn validate_matches(&self, other: &O) -> bool
Source§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more