pub enum FormulaDslError {
ParseError {
reason: String,
},
UnknownIdentifier {
reason: String,
},
InvalidArgument {
reason: String,
},
IncompatibleTerm {
reason: String,
},
MalformedConfig {
reason: String,
},
}Expand description
Typed error surface for the formula DSL parser.
Every variant carries a free-form reason: String payload; Display
emits exactly that payload, so converting a FormulaDslError into
String (via the From impl below) is byte-equivalent to the pre-
refactor Err(format!(...)) / Err("...".to_string()) strings that
the same call sites produced. Public entry points keep their existing
Result<_, String> signatures — CLI input handling stays unchanged —
and typed errors flow across the boundary via From<FormulaDslError> for String.
Variants§
ParseError
Pest grammar failure, unbalanced delimiters, empty terms, or missing required parse fragments — i.e. the formula text is not a well-formed DSL string.
UnknownIdentifier
A referenced symbol (link name, blended-link component, term function name, top-level RHS identifier) is not part of the supported vocabulary.
InvalidArgument
A named option’s value is unparseable, out of range, or not a finite number / valid integer.
IncompatibleTerm
A combination of terms or options is disallowed (duplicate terms, multiple linkwiggle/link/survmodel, mutually exclusive option groups in bounded(), wiggle-incompatible links, etc.).
MalformedConfig
A required configuration option is missing or empty (e.g.
link() without type=, survmodel() with no options,
bounded() without a required argument).
Trait Implementations§
Source§impl Clone for FormulaDslError
impl Clone for FormulaDslError
Source§fn clone(&self) -> FormulaDslError
fn clone(&self) -> FormulaDslError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FormulaDslError
impl Debug for FormulaDslError
Source§impl Display for FormulaDslError
impl Display for FormulaDslError
impl Eq for FormulaDslError
Source§impl Error for FormulaDslError
impl Error for FormulaDslError
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
use the Display impl or to_string()
Source§impl From<FormulaDslError> for String
impl From<FormulaDslError> for String
Source§fn from(err: FormulaDslError) -> String
fn from(err: FormulaDslError) -> String
Source§impl From<String> for FormulaDslError
Inbound conversion from String is used by ? cascades inside parse_formula
and friends so that internal parser helpers still returning Result<_, String>
can flow through without each call site needing an explicit .map_err(...).
We route into ParseError because by construction every internal helper that
still produces a raw String is itself a parse/term-resolution stage.
impl From<String> for FormulaDslError
Inbound conversion from String is used by ? cascades inside parse_formula
and friends so that internal parser helpers still returning Result<_, String>
can flow through without each call site needing an explicit .map_err(...).
We route into ParseError because by construction every internal helper that
still produces a raw String is itself a parse/term-resolution stage.
Source§impl PartialEq for FormulaDslError
impl PartialEq for FormulaDslError
Source§fn eq(&self, other: &FormulaDslError) -> bool
fn eq(&self, other: &FormulaDslError) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for FormulaDslError
Auto Trait Implementations§
impl Freeze for FormulaDslError
impl RefUnwindSafe for FormulaDslError
impl Send for FormulaDslError
impl Sync for FormulaDslError
impl Unpin for FormulaDslError
impl UnsafeUnpin for FormulaDslError
impl UnwindSafe for FormulaDslError
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<T, U> Imply<T> for U
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.