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§
Sourceconst DESCRIPTION: &'static str
const DESCRIPTION: &'static str
A general description of this type of error
Provided Methods§
Sourcefn positions(&self) -> impl IntoIterator<Item = ErrorPosition> + '_
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
Sourcefn one_position(&self) -> CodeOrigin
fn one_position(&self) -> CodeOrigin
Short way to provide a single origin. If you don’t implement this, you must implement ProjectError::positions
Sourcefn pack(self) -> ProjectErrorObj
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".