Struct gluon_base::error::InFile
source · 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)>
The lower-level source of this error, if any. Read more
source§impl<E> PartialEq for InFile<E>where
E: PartialEq,
impl<E> PartialEq for InFile<E>where
E: PartialEq,
impl<E> Eq for InFile<E>where
E: Eq,
Auto Trait Implementations§
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