#[non_exhaustive]pub enum TemplateError {
Invalid(Vec<Issue>),
UnknownType(String),
NotFound(i64),
NoDocument {
type_key: String,
found: usize,
},
Render(String),
PdfDisabled,
NoNotification {
type_key: String,
channel: String,
},
}Expand description
Something the template engine can’t do.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Invalid(Vec<Issue>)
The template has mistakes; each issue says where and what.
UnknownType(String)
No template type has this key.
NotFound(i64)
The template isn’t in the table.
NoDocument
A document was asked for, but the type has no active document template, or several and
none was chosen with named or template.
Fields
Render(String)
The template didn’t render, for example because it ran past a limit.
PdfDisabled
A PDF was asked for, but the crate’s pdf feature is off.
NoNotification
A notification asked for a channel no active template of its type writes for.
Implementations§
Source§impl TemplateError
impl TemplateError
Sourcepub fn issues(&self) -> &[Issue]
pub fn issues(&self) -> &[Issue]
The issues of an TemplateError::Invalid error, for an editor to show next to the fields.
Trait Implementations§
Source§impl Clone for TemplateError
impl Clone for TemplateError
Source§impl Debug for TemplateError
impl Debug for TemplateError
Source§impl Display for TemplateError
impl Display for TemplateError
impl Eq for TemplateError
Source§impl Error for TemplateError
impl Error for TemplateError
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 TemplateError
impl PartialEq for TemplateError
impl StructuralPartialEq for TemplateError
Auto Trait Implementations§
impl Forget for TemplateError
impl Freeze for TemplateError
impl Move for TemplateError
impl RefUnwindSafe for TemplateError
impl Send for TemplateError
impl Sync for TemplateErrorwhere
RawVecInner: Sync,
impl Unpin for TemplateError
impl UnsafeUnpin for TemplateErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<Issue>: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
impl UnwindSafe for TemplateError
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<K> ForeignKey<K> for K
impl<K> ForeignKey<K> for K
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more