pub struct SyntaxError {
pub message: String,
pub line: Option<usize>,
pub snippet: Option<String>,
}Expand description
A structured syntax error with optional line number and source context.
Callers that match on TemplateError::Syntax can inspect line and
snippet programmatically instead of parsing the error message string.
Fields§
§message: StringThe error message (without location prefix).
line: Option<usize>1-based line number where the error occurred (if known).
snippet: Option<String>Snippet of the offending source line (if available).
Implementations§
Source§impl SyntaxError
impl SyntaxError
Trait Implementations§
Source§impl Clone for SyntaxError
impl Clone for SyntaxError
Source§fn clone(&self) -> SyntaxError
fn clone(&self) -> SyntaxError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SyntaxError
impl Debug for SyntaxError
Source§impl Display for SyntaxError
impl Display for SyntaxError
Source§impl From<String> for SyntaxError
Allow TemplateError::Syntax("message".to_string().into()) etc.
impl From<String> for SyntaxError
Allow TemplateError::Syntax("message".to_string().into()) etc.
Source§fn from(message: String) -> SyntaxError
fn from(message: String) -> SyntaxError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SyntaxError
impl RefUnwindSafe for SyntaxError
impl Send for SyntaxError
impl Sync for SyntaxError
impl Unpin for SyntaxError
impl UnsafeUnpin for SyntaxError
impl UnwindSafe for SyntaxError
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