Enum leo_errors::errors::input::input_errors::InputError
source · pub enum InputError {
Formatted(Formatted),
Backtraced(Backtraced),
}Expand description
InputError enum that represents all the errors for the inputs part of leo-ast crate.
Variants§
Formatted(Formatted)
Backtraced(Backtraced)
Implementations§
source§impl InputError
impl InputError
sourcepub fn unexpected_type(
expected: impl Display,
received: impl Display,
span: Span
) -> Self
pub fn unexpected_type( expected: impl Display, received: impl Display, span: Span ) -> Self
For when declared variable type mismatches actual type.
sourcepub fn illegal_expression(expr: impl Display, span: Span) -> Self
pub fn illegal_expression(expr: impl Display, span: Span) -> Self
For when the expression is not allowed in an input file.
sourcepub fn unexpected_section(
expected: &[impl Display],
received: impl Display,
span: Span
) -> Self
pub fn unexpected_section( expected: &[impl Display], received: impl Display, span: Span ) -> Self
For when section name is not an allowed one.
pub fn num_exit_codes() -> i32
Trait Implementations§
source§impl Clone for InputError
impl Clone for InputError
source§fn clone(&self) -> InputError
fn clone(&self) -> InputError
Returns a copy of the value. Read more
1.0.0 · 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 InputError
impl Debug for InputError
source§impl Display for InputError
impl Display for InputError
source§impl Error for InputError
impl Error for InputError
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
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 From<Backtraced> for InputError
impl From<Backtraced> for InputError
source§fn from(source: Backtraced) -> Self
fn from(source: Backtraced) -> Self
Converts to this type from the input type.
source§impl From<Formatted> for InputError
impl From<Formatted> for InputError
source§impl From<InputError> for LeoError
impl From<InputError> for LeoError
source§fn from(source: InputError) -> Self
fn from(source: InputError) -> Self
Converts to this type from the input type.
source§impl LeoMessageCode for InputError
impl LeoMessageCode for InputError
Implements the trait for LeoError Codes.
source§fn error_code(&self) -> String
fn error_code(&self) -> String
Returns the prefixed error identifier.
source§fn warning_code(&self) -> String
fn warning_code(&self) -> String
Returns the prefixed warning identifier.
source§fn message_type() -> String
fn message_type() -> String
Returns the message’s code type for the program.
source§fn 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.