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§
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.
Provided Methods§
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementors§
impl LeoMessageCode for AstError
Implements the trait for LeoError Codes.
impl LeoMessageCode for CliError
Implements the trait for LeoError Codes.
impl LeoMessageCode for CompilerError
Implements the trait for LeoError Codes.
impl LeoMessageCode for FlattenError
Implements the trait for LeoError Codes.
impl LeoMessageCode for LoopUnrollerError
Implements the trait for LeoError Codes.
impl LeoMessageCode for PackageError
Implements the trait for LeoError Codes.
impl LeoMessageCode for ParserError
Implements the trait for LeoError Codes.
impl LeoMessageCode for ParserWarning
Implements the trait for LeoError Codes.
impl LeoMessageCode for StaticAnalyzerError
Implements the trait for LeoError Codes.
impl LeoMessageCode for StaticAnalyzerWarning
Implements the trait for LeoError Codes.
impl LeoMessageCode for TypeCheckerError
Implements the trait for LeoError Codes.
impl LeoMessageCode for TypeCheckerWarning
Implements the trait for LeoError Codes.
impl LeoMessageCode for UtilError
Implements the trait for LeoError Codes.