Skip to main content

ProjectError

Trait ProjectError 

Source
pub trait ProjectError:
    Sized
    + Send
    + Sync
    + 'static {
    const DESCRIPTION: &'static str;

    // Provided methods
    fn message(&self) -> String { ... }
    fn positions(&self) -> impl IntoIterator<Item = ErrorPosition> + '_ { ... }
    fn one_position(&self) -> CodeOrigin { ... }
    fn pack(self) -> ProjectErrorObj { ... }
}
Expand description

Errors addressed to the developer which are to be resolved with code changes

Required Associated Constants§

Source

const DESCRIPTION: &'static str

A general description of this type of error

Provided Methods§

Source

fn message(&self) -> String

A formatted message that includes specific parameters

Source

fn positions(&self) -> impl IntoIterator<Item = ErrorPosition> + '_

Code positions relevant to this error. If you don’t implement this, you must implement ProjectError::one_position

Source

fn one_position(&self) -> CodeOrigin

Short way to provide a single origin. If you don’t implement this, you must implement ProjectError::positions

Source

fn pack(self) -> ProjectErrorObj

Convert the error into an Arc<dyn DynProjectError> to be able to handle various errors together

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl ProjectError for MacroTimeout

Source§

const DESCRIPTION: &'static str = "Macro execution has not halted"

Source§

impl ProjectError for MissingSystemCode

Source§

const DESCRIPTION: &'static str = "A system tried to import a path that doesn't exist"

Source§

impl<E: SubError> ProjectError for MissingSymbol<E>

Source§

const DESCRIPTION: &'static str = "A name not referring to a known symbol was found in the source after \ macro execution. This can either mean that a symbol name was mistyped, or \ that macro execution didn't correctly halt."