#[non_exhaustive]pub struct SqlError {
pub line: u32,
pub col: u32,
pub message: String,
}Expand description
A compile error, anchored to the source: line N, col C: message.
Every refusal is named and teaches the kevy-shaped alternative —
e.g. JOIN is not compilable — kevy refuses query-time joins (Law 3); model the lookup with an indexed FK column ….
let e = kevy_sql::compile("CREATE TABLE t (id bigint PRIMARY KEY, x money);").unwrap_err();
assert_eq!((e.line, e.col), (1, 40));
assert!(e.to_string().starts_with("line 1, col 40: "));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.line: u321-based source line.
let e = kevy_sql::compile("CREATE TABLE t (id bigint PRIMARY KEY, x money);").unwrap_err();
assert_eq!(e.line, 1);col: u321-based source column; here it points at the unmappable money.
let e = kevy_sql::compile("CREATE TABLE t (id bigint PRIMARY KEY, x money);").unwrap_err();
assert_eq!(e.col, 40);message: StringThe named refusal / error text.
let e = kevy_sql::compile("CREATE TABLE t (id bigint PRIMARY KEY, x money);").unwrap_err();
assert!(e.message.contains("money"));Trait Implementations§
impl Eq for SqlError
Source§impl Error for SqlError
impl Error for SqlError
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()
impl StructuralPartialEq for SqlError
Auto Trait Implementations§
impl Freeze for SqlError
impl RefUnwindSafe for SqlError
impl Send for SqlError
impl Sync for SqlError
impl Unpin for SqlError
impl UnsafeUnpin for SqlError
impl UnwindSafe for SqlError
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