Trait leo_errors::common::traits::LeoMessageCode

source ·
pub trait LeoMessageCode: Sized {
    // Required methods
    fn exit_code(&self) -> i32;
    fn error_code(&self) -> String;
    fn warning_code(&self) -> String;
    fn code_mask() -> i32;
    fn message_type() -> String;
    fn is_error() -> bool;

    // Provided method
    fn code_identifier() -> i8 { ... }
}
Expand description

MessageCode trait that all Errors should implement.

Required Methods§

source

fn exit_code(&self) -> i32

Returns the error’s exit code for the program.

source

fn error_code(&self) -> String

Returns the prefixed error identifier.

source

fn warning_code(&self) -> String

Returns the prefixed warning identifier.

source

fn code_mask() -> i32

Returns the messages’s exit code mask, as to avoid conflicts.

source

fn message_type() -> String

Returns the message’s code type for the program.

source

fn is_error() -> bool

Returns if the message is an error or warning.

Provided Methods§

source

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.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl LeoMessageCode for AstError

Implements the trait for LeoError Codes.

source§

impl LeoMessageCode for CliError

Implements the trait for LeoError Codes.

source§

impl LeoMessageCode for CompilerError

Implements the trait for LeoError Codes.

source§

impl LeoMessageCode for FlattenError

Implements the trait for LeoError Codes.

source§

impl LeoMessageCode for LoopUnrollerError

Implements the trait for LeoError Codes.

source§

impl LeoMessageCode for PackageError

Implements the trait for LeoError Codes.

source§

impl LeoMessageCode for ParserError

Implements the trait for LeoError Codes.

source§

impl LeoMessageCode for ParserWarning

Implements the trait for LeoError Codes.

source§

impl LeoMessageCode for TypeCheckerError

Implements the trait for LeoError Codes.

source§

impl LeoMessageCode for TypeCheckerWarning

Implements the trait for LeoError Codes.

source§

impl LeoMessageCode for UtilError

Implements the trait for LeoError Codes.