Struct leo_errors::common::formatted::Formatted
source · pub struct Formatted {
pub span: Span,
pub backtrace: Backtraced,
}Expand description
Formatted compiler error type
undefined value x
–> file.leo: 2:8
|
2 | let a = x;
| ^
|
= help: Initialize a variable x first.
Makes use of the same fields as a BacktracedError.
Fields§
§span: SpanThe formatted error span information.
backtrace: BacktracedThe backtrace to track where the Leo error originated.
Implementations§
source§impl Formatted
impl Formatted
sourcepub fn new_from_span<S>(
message: S,
help: Option<String>,
code: i32,
code_identifier: i8,
type_: String,
error: bool,
span: Span,
backtrace: Backtrace
) -> Selfwhere
S: ToString,
pub fn new_from_span<S>( message: S, help: Option<String>, code: i32, code_identifier: i8, type_: String, error: bool, span: Span, backtrace: Backtrace ) -> Selfwhere S: ToString,
Creates a backtraced error from a span and a backtrace.
sourcepub fn error_code(&self) -> String
pub fn error_code(&self) -> String
Returns an error identifier.
sourcepub fn warning_code(&self) -> String
pub fn warning_code(&self) -> String
Returns an warning identifier.
Trait Implementations§
source§impl Error for Formatted
impl Error for Formatted
source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
1.30.0 · source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more