pub struct HedlError {
pub kind: HedlErrorKind,
pub message: String,
pub line: usize,
pub column: Option<usize>,
pub context: Option<String>,
}Expand description
An error that occurred during HEDL parsing.
Fields§
§kind: HedlErrorKindThe kind of error.
message: StringHuman-readable error message.
line: usizeLine number (1-based).
column: Option<usize>Column number (1-based, optional).
context: Option<String>Additional context (e.g., “in list User started at line 5”).
Implementations§
Source§impl HedlError
impl HedlError
Sourcepub fn new(kind: HedlErrorKind, message: impl Into<String>, line: usize) -> Self
pub fn new(kind: HedlErrorKind, message: impl Into<String>, line: usize) -> Self
Create a new error.
Sourcepub fn with_column(self, column: usize) -> Self
pub fn with_column(self, column: usize) -> Self
Add column information.
Sourcepub fn with_context(self, context: impl Into<String>) -> Self
pub fn with_context(self, context: impl Into<String>) -> Self
Add context information.
Sourcepub fn syntax(message: impl Into<String>, line: usize) -> Self
pub fn syntax(message: impl Into<String>, line: usize) -> Self
Creates a syntax error at the given line.
Sourcepub fn version(message: impl Into<String>, line: usize) -> Self
pub fn version(message: impl Into<String>, line: usize) -> Self
Creates a version error at the given line.
Sourcepub fn schema(message: impl Into<String>, line: usize) -> Self
pub fn schema(message: impl Into<String>, line: usize) -> Self
Creates a schema error at the given line.
Sourcepub fn alias(message: impl Into<String>, line: usize) -> Self
pub fn alias(message: impl Into<String>, line: usize) -> Self
Creates an alias error at the given line.
Sourcepub fn shape(message: impl Into<String>, line: usize) -> Self
pub fn shape(message: impl Into<String>, line: usize) -> Self
Creates a shape error at the given line.
Sourcepub fn semantic(message: impl Into<String>, line: usize) -> Self
pub fn semantic(message: impl Into<String>, line: usize) -> Self
Creates a semantic error at the given line.
Sourcepub fn orphan_row(message: impl Into<String>, line: usize) -> Self
pub fn orphan_row(message: impl Into<String>, line: usize) -> Self
Creates an orphan row error at the given line.
Sourcepub fn collision(message: impl Into<String>, line: usize) -> Self
pub fn collision(message: impl Into<String>, line: usize) -> Self
Creates a collision error at the given line.
Sourcepub fn reference(message: impl Into<String>, line: usize) -> Self
pub fn reference(message: impl Into<String>, line: usize) -> Self
Creates a reference error at the given line.
Sourcepub fn security(message: impl Into<String>, line: usize) -> Self
pub fn security(message: impl Into<String>, line: usize) -> Self
Creates a security error at the given line.
Sourcepub fn conversion(message: impl Into<String>) -> Self
pub fn conversion(message: impl Into<String>) -> Self
Creates a conversion error (no line context).
Sourcepub fn type_mismatch(message: impl Into<String>, line: usize) -> Self
pub fn type_mismatch(message: impl Into<String>, line: usize) -> Self
Create a type mismatch error (semantic error kind).
Trait Implementations§
Source§impl Error for HedlError
impl Error for HedlError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Auto Trait Implementations§
impl Freeze for HedlError
impl RefUnwindSafe for HedlError
impl Send for HedlError
impl Sync for HedlError
impl Unpin for HedlError
impl UnwindSafe for HedlError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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