pub enum CodegenError {
RenderError {
component: String,
context: String,
message: String,
},
FormatError {
context: String,
source: Error,
},
ValidationError {
reason: String,
suggestion: Option<String>,
},
InvalidIdentifier {
name: String,
context: String,
reason: String,
},
UnsupportedType {
type_name: String,
context: String,
reason: String,
alternative: Option<String>,
},
MaxDepthExceeded {
context: String,
max_depth: usize,
},
}Expand description
Errors that can occur during code generation
Each error variant provides detailed context about what went wrong during the code generation process.
Variants§
RenderError
Failed to render a specific part of the code
This typically indicates a bug in the generator logic.
Fields
FormatError
String formatting error
This occurs when writing to the output buffer fails.
ValidationError
Module validation failed
The IR module contains invalid data that cannot be generated.
Fields
InvalidIdentifier
Empty or invalid identifier name
Fields
UnsupportedType
Unsupported type encountered
Fields
MaxDepthExceeded
Maximum recursion depth exceeded
Prevents stack overflow from deeply nested types.
Implementations§
Source§impl CodegenError
impl CodegenError
Sourcepub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: impl Into<String>) -> Self
Add a suggestion to an error
Trait Implementations§
Source§impl Debug for CodegenError
impl Debug for CodegenError
Source§impl Display for CodegenError
impl Display for CodegenError
Source§impl Error for CodegenError
impl Error for CodegenError
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()
Auto Trait Implementations§
impl Freeze for CodegenError
impl RefUnwindSafe for CodegenError
impl Send for CodegenError
impl Sync for CodegenError
impl Unpin for CodegenError
impl UnsafeUnpin for CodegenError
impl UnwindSafe for CodegenError
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