pub struct ErrorDisplay {
pub id: String,
pub config: ErrorDisplayConfig,
}Expand description
Rust-style error message rendering component with line indicators and caret positioning
Fields§
§id: StringUnique identifier for this error display instance
config: ErrorDisplayConfigConfiguration for error display styling
Implementations§
Source§impl ErrorDisplay
impl ErrorDisplay
Sourcepub fn new(id: String, config: ErrorDisplayConfig) -> Self
pub fn new(id: String, config: ErrorDisplayConfig) -> Self
Create a new error display with specified ID and config
Sourcepub fn with_defaults(id: String) -> Self
pub fn with_defaults(id: String) -> Self
Create error display with default configuration
Sourcepub fn with_terminal_config(id: String) -> Self
pub fn with_terminal_config(id: String) -> Self
Create error display optimized for terminal
Sourcepub fn with_detailed_config(id: String) -> Self
pub fn with_detailed_config(id: String) -> Self
Create error display optimized for detailed debugging
Sourcepub fn with_syntax_highlighting(id: String, language: String) -> Self
pub fn with_syntax_highlighting(id: String, language: String) -> Self
Create error display with syntax highlighting for specific language
Sourcepub fn with_custom_syntax_config(
id: String,
syntax_config: SyntaxHighlightConfig,
) -> Self
pub fn with_custom_syntax_config( id: String, syntax_config: SyntaxHighlightConfig, ) -> Self
Create error display with custom syntax highlighting config
Sourcepub fn format_error(&self, error: &ErrorInfo, content: &str) -> String
pub fn format_error(&self, error: &ErrorInfo, content: &str) -> String
Generate Rust-style error display text
Sourcepub fn render(
&self,
error: &ErrorInfo,
content: &str,
bounds: &Bounds,
buffer: &mut ScreenBuffer,
)
pub fn render( &self, error: &ErrorInfo, content: &str, bounds: &Bounds, buffer: &mut ScreenBuffer, )
Render error display within bounds
Sourcepub fn render_multiple(
&self,
errors: &[ErrorInfo],
content: &str,
bounds: &Bounds,
buffer: &mut ScreenBuffer,
)
pub fn render_multiple( &self, errors: &[ErrorInfo], content: &str, bounds: &Bounds, buffer: &mut ScreenBuffer, )
Render multiple errors in sequence
Sourcepub fn apply_syntax_highlighting(&self, line: &str) -> String
pub fn apply_syntax_highlighting(&self, line: &str) -> String
Apply syntax highlighting to a line of code
Sourcepub fn format_error_with_highlighting(
&self,
error: &ErrorInfo,
content: &str,
) -> String
pub fn format_error_with_highlighting( &self, error: &ErrorInfo, content: &str, ) -> String
Generate syntax-highlighted error display text
Sourcepub fn from_yaml_error(
yaml_error: &Error,
file_path: &str,
message: String,
) -> Option<ErrorInfo>
pub fn from_yaml_error( yaml_error: &Error, file_path: &str, message: String, ) -> Option<ErrorInfo>
Create ErrorInfo from serde_yaml::Error
Sourcepub fn validation_error(
file_path: &str,
line_number: usize,
column_number: usize,
message: String,
) -> ErrorInfo
pub fn validation_error( file_path: &str, line_number: usize, column_number: usize, message: String, ) -> ErrorInfo
Create ErrorInfo for configuration validation
Sourcepub fn render_with_enhanced_carets(
&self,
error: &ErrorInfo,
content: &str,
bounds: &Bounds,
buffer: &mut ScreenBuffer,
)
pub fn render_with_enhanced_carets( &self, error: &ErrorInfo, content: &str, bounds: &Bounds, buffer: &mut ScreenBuffer, )
Render error with enhanced multi-line caret positioning
Sourcepub fn format_error_with_multi_line_carets(
&self,
error: &ErrorInfo,
content: &str,
caret_positioning: &CaretPositioning,
) -> String
pub fn format_error_with_multi_line_carets( &self, error: &ErrorInfo, content: &str, caret_positioning: &CaretPositioning, ) -> String
Format error message with enhanced multi-line caret positioning
Sourcepub fn create_multi_line_error(
message: String,
file_path: String,
start_line: usize,
start_column: usize,
end_line: usize,
end_column: usize,
severity: ErrorSeverity,
) -> ErrorInfo
pub fn create_multi_line_error( message: String, file_path: String, start_line: usize, start_column: usize, end_line: usize, end_column: usize, severity: ErrorSeverity, ) -> ErrorInfo
Create ErrorInfo with enhanced caret positioning for multi-line errors
Auto Trait Implementations§
impl Freeze for ErrorDisplay
impl RefUnwindSafe for ErrorDisplay
impl Send for ErrorDisplay
impl Sync for ErrorDisplay
impl Unpin for ErrorDisplay
impl UnsafeUnpin for ErrorDisplay
impl UnwindSafe for ErrorDisplay
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.