Struct arithmetic_typing::error::Error
source · pub struct Error<Prim: PrimitiveType> { /* private fields */ }
Expand description
Type error together with the corresponding code span.
Implementations§
source§impl<Prim: PrimitiveType> Error<Prim>
impl<Prim: PrimitiveType> Error<Prim>
sourcepub fn main_location(&self) -> Location
pub fn main_location(&self) -> Location
Gets the most specific code span of this error.
sourcepub fn root_location(&self) -> Location
pub fn root_location(&self) -> Location
Gets the root code location of the failed operation. May coincide with Self::main_location()
.
sourcepub fn context(&self) -> &ErrorContext<Prim>
pub fn context(&self) -> &ErrorContext<Prim>
Gets the context for an operation that has failed.
sourcepub fn path(&self) -> &[ErrorPathFragment]
pub fn path(&self) -> &[ErrorPathFragment]
Gets the path of this error relative to the failed top-level operation.
This can be used for highlighting relevant parts of types in Self::context()
.
Trait Implementations§
source§impl<Prim: PrimitiveType> Display for Error<Prim>
impl<Prim: PrimitiveType> Display for Error<Prim>
source§impl<Prim: PrimitiveType> Error for Error<Prim>
impl<Prim: PrimitiveType> Error for Error<Prim>
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()
Auto Trait Implementations§
impl<Prim> Freeze for Error<Prim>where
Prim: Freeze,
impl<Prim> !RefUnwindSafe for Error<Prim>
impl<Prim> Send for Error<Prim>
impl<Prim> Sync for Error<Prim>
impl<Prim> Unpin for Error<Prim>where
Prim: Unpin,
impl<Prim> !UnwindSafe for Error<Prim>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)