pub struct ErrorAnnotation<S, I> {
pub source: S,
pub label: &'static str,
pub info: I,
}Expand description
Combine a source error with labeled diagnostic information.
ErrorAnnotation combines a source error of type S with diagnostic info of type I
which will be labeled with label when displayed.
Fields§
§source: S§label: &'static str§info: IImplementations§
Source§impl<S, I> ErrorAnnotation<S, I>
impl<S, I> ErrorAnnotation<S, I>
Sourcepub fn map_source<F, T>(self, f: F) -> ErrorAnnotation<T, I>where
F: FnOnce(S) -> T,
pub fn map_source<F, T>(self, f: F) -> ErrorAnnotation<T, I>where
F: FnOnce(S) -> T,
Transform the source while leaving the annotated info.
Sourcepub fn map_info<F, J>(self, f: F) -> ErrorAnnotation<S, J>
pub fn map_info<F, J>(self, f: F) -> ErrorAnnotation<S, J>
Transform the info with a new label, leaving the original source.
Trait Implementations§
Auto Trait Implementations§
impl<S, I> Freeze for ErrorAnnotation<S, I>
impl<S, I> RefUnwindSafe for ErrorAnnotation<S, I>where
S: RefUnwindSafe,
I: RefUnwindSafe,
impl<S, I> Send for ErrorAnnotation<S, I>
impl<S, I> Sync for ErrorAnnotation<S, I>
impl<S, I> Unpin for ErrorAnnotation<S, I>
impl<S, I> UnwindSafe for ErrorAnnotation<S, I>where
S: UnwindSafe,
I: UnwindSafe,
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