pub struct SemanticError { /* private fields */ }Implementations§
Source§impl SemanticError
impl SemanticError
pub fn new(message: impl Into<String>, span: Span) -> Self
pub fn with_note(self, note: impl Into<String>) -> Self
pub fn with_help(self, help: impl Into<String>) -> Self
pub fn with_secondary_label( self, span: Span, message: impl Into<String>, ) -> Self
pub fn with_context_label(self, span: Span, message: impl Into<String>) -> Self
pub fn with_suggestion(self, suggestion: DiagnosticSuggestion) -> Self
pub fn diagnostic(&self) -> &Diagnostic
pub fn into_diagnostic(self) -> Diagnostic
pub fn render(&self, src: &str) -> String
pub fn diagnostic_report( &self, source_name: impl Into<String>, ) -> DiagnosticReport
pub fn with_source(self, source: impl Into<Arc<str>>) -> Self
pub fn source(&self) -> Option<&str>
Trait Implementations§
Source§impl Clone for SemanticError
impl Clone for SemanticError
Source§fn clone(&self) -> SemanticError
fn clone(&self) -> SemanticError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SemanticError
impl Debug for SemanticError
Source§impl Display for SemanticError
impl Display for SemanticError
Source§impl Error for SemanticError
impl Error for SemanticError
1.30.0 · 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()
Source§impl PartialEq for SemanticError
impl PartialEq for SemanticError
Source§fn eq(&self, other: &SemanticError) -> bool
fn eq(&self, other: &SemanticError) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for SemanticError
impl StructuralPartialEq for SemanticError
Auto Trait Implementations§
impl Freeze for SemanticError
impl RefUnwindSafe for SemanticError
impl Send for SemanticError
impl Sync for SemanticError
impl Unpin for SemanticError
impl UnsafeUnpin for SemanticError
impl UnwindSafe for SemanticError
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