pub enum GenerateError {
TypeMismatch {
expected: &'static str,
found: &'static str,
},
Overflow(String),
Exhausted(String),
InvalidInput(String),
Diagnostics(DiagnosticBag),
Diagnostic(Box<Diagnostic>),
}Expand description
Errors returned while running a compiled generator or modifier.
Variants§
TypeMismatch
A typed accessor was called on a value of a different variant.
Overflow(String)
A generator’s internal state (e.g. a sequence’s counter) could not
advance without wrapping past its representable range.
Exhausted(String)
A modifier (e.g. unique) could not satisfy its constraint within
its configured attempt budget.
InvalidInput(String)
A generator could not make sense of a value it depends on at row
time (e.g. before/after reading an unparsable source column).
Diagnostics(DiagnosticBag)
Structured diagnostics from loading, merging, or compiling a model,
surfaced through the public crate::generate::Generate API (e.g.
ModelCompiler::compile errors, or ModelMerger::merge errors).
Carries the full bag, including any warnings, so a caller can report
every problem rather than just the first.
Diagnostic(Box<Diagnostic>)
One structured runtime diagnostic. Unlike Self::Diagnostics, this
variant represents a single failure discovered after compilation.
Implementations§
Source§impl GenerateError
impl GenerateError
Sourcepub fn diagnostic(
definition: &'static DiagnosticDefinition,
path: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn diagnostic( definition: &'static DiagnosticDefinition, path: impl Into<String>, message: impl Into<String>, ) -> Self
Construct a structured built-in runtime failure.
Trait Implementations§
Source§impl Clone for GenerateError
impl Clone for GenerateError
Source§fn clone(&self) -> GenerateError
fn clone(&self) -> GenerateError
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 GenerateError
impl Debug for GenerateError
Source§impl Display for GenerateError
impl Display for GenerateError
impl Eq for GenerateError
Source§impl Error for GenerateError
impl Error for GenerateError
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 PartialEq for GenerateError
impl PartialEq for GenerateError
impl StructuralPartialEq for GenerateError
Auto Trait Implementations§
impl Freeze for GenerateError
impl RefUnwindSafe for GenerateError
impl Send for GenerateError
impl Sync for GenerateError
impl Unpin for GenerateError
impl UnsafeUnpin for GenerateError
impl UnwindSafe for GenerateError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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