Enum leo_errors::errors::ast::ast_errors::AstError
source · pub enum AstError {
Formatted(Formatted),
Backtraced(Backtraced),
}Expand description
AstError enum that represents all the errors for the leo-ast crate.
Variants
Formatted(Formatted)
Backtraced(Backtraced)
Implementations
sourceimpl AstError
impl AstError
sourcepub fn failed_to_convert_ast_to_json_string(error: impl ErrorArg) -> Self
pub fn failed_to_convert_ast_to_json_string(error: impl ErrorArg) -> Self
For when the AST fails to be represented as a JSON string.
sourcepub fn failed_to_create_ast_json_file(
path: impl Debug,
error: impl ErrorArg
) -> Self
pub fn failed_to_create_ast_json_file(
path: impl Debug,
error: impl ErrorArg
) -> Self
For when the AST fails to create the AST JSON file.
sourcepub fn failed_to_write_ast_to_json_file(
path: impl Debug,
error: impl ErrorArg
) -> Self
pub fn failed_to_write_ast_to_json_file(
path: impl Debug,
error: impl ErrorArg
) -> Self
For when the AST fails to write the AST JSON file.
sourcepub fn failed_to_read_json_string_to_ast(error: impl ErrorArg) -> Self
pub fn failed_to_read_json_string_to_ast(error: impl ErrorArg) -> Self
For when the a JSON string fails to be represented as an AST.
sourcepub fn failed_to_read_json_file(path: impl Debug, error: impl ErrorArg) -> Self
pub fn failed_to_read_json_file(path: impl Debug, error: impl ErrorArg) -> Self
For when the a JSON files fails to be represented as an AST.
sourcepub fn failed_to_convert_ast_to_json_value(error: impl ErrorArg) -> Self
pub fn failed_to_convert_ast_to_json_value(error: impl ErrorArg) -> Self
For when the AST fails to be represented as a JSON value.
sourcepub fn empty_tuple(span: Span) -> Self
pub fn empty_tuple(span: Span) -> Self
For when a user tries to define an empty tuple.
sourcepub fn one_element_tuple(span: Span) -> Self
pub fn one_element_tuple(span: Span) -> Self
For when a user tries to define a tuple dimension of one.
sourcepub fn shadowed_function(func: impl Display, span: Span) -> Self
pub fn shadowed_function(func: impl Display, span: Span) -> Self
For when a user shadows a function.
sourcepub fn shadowed_struct(struct_: impl Display, span: Span) -> Self
pub fn shadowed_struct(struct_: impl Display, span: Span) -> Self
For when a user shadows a struct.
sourcepub fn shadowed_record(record: impl Display, span: Span) -> Self
pub fn shadowed_record(record: impl Display, span: Span) -> Self
For when a user shadows a record.
sourcepub fn shadowed_variable(var: impl Display, span: Span) -> Self
pub fn shadowed_variable(var: impl Display, span: Span) -> Self
For when a user shadows a variable.
pub fn num_exit_codes() -> i32
Trait Implementations
sourceimpl Error for AstError
impl Error for AstError
sourcefn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
The lower-level source of this error, if any. Read more
1.0.0 · sourcefn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
sourceimpl From<Backtraced> for AstError
impl From<Backtraced> for AstError
sourcefn from(source: Backtraced) -> Self
fn from(source: Backtraced) -> Self
Converts to this type from the input type.
sourceimpl LeoMessageCode for AstError
impl LeoMessageCode for AstError
Implements the trait for LeoError Codes.
sourcefn error_code(&self) -> String
fn error_code(&self) -> String
Returns the prefixed error identifier.
sourcefn warning_code(&self) -> String
fn warning_code(&self) -> String
Returns the prefixed warning identifier.
sourcefn message_type() -> String
fn message_type() -> String
Returns the message’s code type for the program.
sourcefn code_identifier() -> i8
fn code_identifier() -> i8
The LeoErrorCode which has a default code identifier of 037
(Leo upsidedown and backwards). This is to make the exit codes
unique to Leo itself. Read more
Auto Trait Implementations
impl RefUnwindSafe for AstError
impl Send for AstError
impl Sync for AstError
impl Unpin for AstError
impl UnwindSafe for AstError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more