#[non_exhaustive]pub enum TemplateError {
Io(Error),
Reqwest(Error),
InvalidSyntax(String),
RenderError(String),
MissingVariable(String),
InvalidOperation(String),
}Expand description
Represents errors specific to template processing.
This error type focuses on issues related to the manipulation of templates, such as syntax errors, rendering failures, or invalid input data.
§Examples
use staticweaver_core::TemplateError;
let err = TemplateError::MissingVariable("name".to_string());
assert_eq!(err.to_string(), "Missing variable: name");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.
Io(Error)
I/O error encountered during template operations. Only
available with the std feature (the default).
Reqwest(Error)
Network request error. Only available when the remote-templates
feature is enabled.
InvalidSyntax(String)
Error triggered by invalid template syntax.
RenderError(String)
Error during rendering, such as unresolved template tags or missing context.
MissingVariable(String)
Error when a required variable is missing from the context.
InvalidOperation(String)
Error when an invalid operation is attempted on a template.
Trait Implementations§
Source§impl Debug for TemplateError
impl Debug for TemplateError
Source§impl Display for TemplateError
impl Display for TemplateError
Source§impl Error for TemplateError
impl Error for TemplateError
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 From<Error> for TemplateError
impl From<Error> for TemplateError
Source§fn from(source: Error) -> TemplateError
fn from(source: Error) -> TemplateError
Converts to this type from the input type.
Source§impl From<Error> for TemplateError
impl From<Error> for TemplateError
Source§fn from(source: Error) -> TemplateError
fn from(source: Error) -> TemplateError
Converts to this type from the input type.
Source§impl From<TemplateError> for EngineError
impl From<TemplateError> for EngineError
Source§fn from(source: TemplateError) -> EngineError
fn from(source: TemplateError) -> EngineError
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for TemplateError
impl !UnwindSafe for TemplateError
impl Freeze for TemplateError
impl Send for TemplateError
impl Sync for TemplateError
impl Unpin for TemplateError
impl UnsafeUnpin 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