pub struct InFile<E> { /* private fields */ }Expand description
Error type which contains information of which file and where in the file the error occurred
Implementations§
Source§impl<E: Display> InFile<E>
impl<E: Display> InFile<E>
Sourcepub fn new(source: CodeMap, error: Errors<Spanned<E, BytePos>>) -> InFile<E>
pub fn new(source: CodeMap, error: Errors<Spanned<E, BytePos>>) -> InFile<E>
Creates a new InFile error which states that the error occurred in file using the file
contents in source to provide a context to the span.
pub fn source_name(&self) -> &str
pub fn source(&self) -> &CodeMap
pub fn errors(&self) -> &Errors<Spanned<E, BytePos>>
pub fn into_errors(self) -> Errors<Spanned<E, BytePos>>
pub fn emit_string(&self) -> Result<String>where
E: AsDiagnostic,
pub fn emit(&self, writer: &mut dyn WriteColor) -> Result<()>where
E: AsDiagnostic,
Trait Implementations§
Source§impl<E: Display + Debug + Any + AsDiagnostic> Error for InFile<E>
impl<E: Display + Debug + Any + AsDiagnostic> Error for InFile<E>
Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
impl<E> Eq for InFile<E>where
E: Eq,
Auto Trait Implementations§
impl<E> Freeze for InFile<E>
impl<E> RefUnwindSafe for InFile<E>where
E: RefUnwindSafe,
impl<E> Send for InFile<E>where
E: Send,
impl<E> Sync for InFile<E>where
E: Sync,
impl<E> Unpin for InFile<E>where
E: Unpin,
impl<E> UnwindSafe for InFile<E>where
E: 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
Source§impl<T> CallHasher for T
impl<T> CallHasher for T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more