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§
Source§impl 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 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.
Sourcepub fn failed_to_convert_symbol_table_to_json_string(
error: impl ErrorArg,
) -> Self
pub fn failed_to_convert_symbol_table_to_json_string( error: impl ErrorArg, ) -> Self
For when the symbol table fails to be represented as a JSON string.
Sourcepub fn failed_to_create_symbol_table_json_file(
path: impl Debug,
error: impl ErrorArg,
) -> Self
pub fn failed_to_create_symbol_table_json_file( path: impl Debug, error: impl ErrorArg, ) -> Self
For when the symbol table fails to create the symbol table JSON file.
Sourcepub fn failed_to_write_symbol_table_to_json_file(
path: impl Debug,
error: impl ErrorArg,
) -> Self
pub fn failed_to_write_symbol_table_to_json_file( path: impl Debug, error: impl ErrorArg, ) -> Self
For when the symbol table fails to write the symbol table JSON file.
Sourcepub fn failed_to_read_json_string_to_symbol_table(error: impl ErrorArg) -> Self
pub fn failed_to_read_json_string_to_symbol_table(error: impl ErrorArg) -> Self
For when the a JSON string fails to be represented as an symbol table.
Sourcepub fn failed_to_convert_symbol_table_to_json_value(
error: impl ErrorArg,
) -> Self
pub fn failed_to_convert_symbol_table_to_json_value( error: impl ErrorArg, ) -> Self
For when the symbol table fails to be represented as a JSON value.
pub fn redefining_external_struct(struct_: impl Display, span: Span) -> Self
pub fn function_not_found(func: impl Display) -> Self
pub fn name_defined_multiple_times(name: impl Display, span: Span) -> Self
pub fn num_exit_codes() -> i32
pub fn with_labels(self, labels: Vec<Label>) -> Self
Trait Implementations§
Source§impl Error for AstError
impl Error for AstError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
Source§impl From<Backtraced> for AstError
impl From<Backtraced> for AstError
Source§fn from(source: Backtraced) -> Self
fn from(source: Backtraced) -> Self
Source§impl LeoMessageCode for AstError
Implements the trait for LeoError Codes.
impl LeoMessageCode for AstError
Implements the trait for LeoError Codes.
Source§fn error_code(&self) -> String
fn error_code(&self) -> String
Source§fn warning_code(&self) -> String
fn warning_code(&self) -> String
Source§fn message_type() -> String
fn message_type() -> String
Source§fn code_identifier() -> i8
fn code_identifier() -> i8
Auto Trait Implementations§
impl Freeze for AstError
impl RefUnwindSafe for AstError
impl Send for AstError
impl Sync for AstError
impl Unpin for AstError
impl UnsafeUnpin for AstError
impl UnwindSafe for AstError
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more