#[non_exhaustive]pub enum Error {
InvalidName(String),
NotFound(String),
Io {
path: PathBuf,
source: Error,
},
Syntax {
template: String,
line: usize,
column: usize,
message: String,
},
Render {
template: String,
line: usize,
message: String,
},
RenderUnlocated {
template: String,
message: String,
},
FragmentNotFound {
template: String,
fragment: String,
},
Cycle(String),
DependencyDepth(String),
Number(String),
Data(Error),
}Expand description
A Sword lookup, syntax, or rendering failure.
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.
InvalidName(String)
The view name is empty or contains a path separator or traversal.
NotFound(String)
No template root contains the view.
Io
A template file could not be read.
Syntax
The template source is not valid Sword.
Fields
Render
Rendering failed at a known line of the original source.
Fields
RenderUnlocated
A backend error whose original line is unavailable.
FragmentNotFound
The render succeeded but never reached an @fragment with the requested name.
Cycle(String)
Templates include or extend each other in a cycle.
DependencyDepth(String)
A chain of includes, layouts and components is more than 64 templates deep.
Number(String)
View data holds a number that cannot be represented.
Data(Error)
View data could not be serialized.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Errorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const () is !null: Freeze,
PhantomData<ErrorData<CustomOwner>>: Freeze,
*const ErrorImpl is !null: Freeze,
PhantomData<ErrorImpl>: Freeze,
impl Move for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Errorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const () is !null: UnsafeUnpin,
PhantomData<ErrorData<CustomOwner>>: UnsafeUnpin,
*const ErrorImpl is !null: UnsafeUnpin,
PhantomData<ErrorImpl>: UnsafeUnpin,
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