Skip to main content

oxilean_runtime/eval_error/
errorsource_traits.rs

1//! # ErrorSource - Trait Implementations
2//!
3//! This module contains trait implementations for `ErrorSource`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Display`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::types::ErrorSource;
12use std::fmt;
13
14impl fmt::Display for ErrorSource {
15    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
16        match self {
17            ErrorSource::Kernel => write!(f, "kernel"),
18            ErrorSource::Elaborator => write!(f, "elaborator"),
19            ErrorSource::TypeChecker => write!(f, "type-checker"),
20            ErrorSource::UserCode { decl_name } => write!(f, "user-code({})", decl_name),
21            ErrorSource::IoMonad => write!(f, "io-monad"),
22            ErrorSource::BytecodeInterp { chunk_name, ip } => {
23                write!(f, "bytecode-interp({}@{})", chunk_name, ip)
24            }
25            ErrorSource::Unknown => write!(f, "unknown"),
26        }
27    }
28}