pub struct FormulaErrorContext {
pub formula: String,
pub location: String,
pub error: String,
pub suggestion: Option<String>,
pub available_columns: Vec<String>,
}Expand description
Rich error context for formula evaluation failures (v4.1.0)
Fields§
§formula: StringThe original formula that failed
location: StringLocation: table.column or scalar name
error: StringWhat went wrong
suggestion: Option<String>Suggestion for fixing (optional)
available_columns: Vec<String>Available columns in context (for “did you mean?” suggestions)
Implementations§
Source§impl FormulaErrorContext
impl FormulaErrorContext
pub fn new(formula: &str, location: &str, error: &str) -> Self
pub fn with_suggestion(self, suggestion: &str) -> Self
pub fn with_available_columns(self, columns: Vec<String>) -> Self
Sourcepub fn find_similar(&self, target: &str) -> Option<String>
pub fn find_similar(&self, target: &str) -> Option<String>
Find similar column names for “did you mean?” suggestions
Sourcepub fn format_error(&self) -> String
pub fn format_error(&self) -> String
Format the error message with context
Trait Implementations§
Source§impl Clone for FormulaErrorContext
impl Clone for FormulaErrorContext
Source§fn clone(&self) -> FormulaErrorContext
fn clone(&self) -> FormulaErrorContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for FormulaErrorContext
impl RefUnwindSafe for FormulaErrorContext
impl Send for FormulaErrorContext
impl Sync for FormulaErrorContext
impl Unpin for FormulaErrorContext
impl UnsafeUnpin for FormulaErrorContext
impl UnwindSafe for FormulaErrorContext
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