pub struct TranspileError {
pub kind: ErrorKind,
pub location: Option<SourceLocation>,
pub context: Vec<String>,
pub source: Option<Box<dyn Error + Send + Sync>>,
}Expand description
Context-aware transpilation error
Fields§
§kind: ErrorKind§location: Option<SourceLocation>§context: Vec<String>§source: Option<Box<dyn Error + Send + Sync>>Implementations§
Source§impl TranspileError
impl TranspileError
Sourcepub fn new(kind: ErrorKind) -> TranspileError
pub fn new(kind: ErrorKind) -> TranspileError
Create a new error with the given kind
Sourcepub fn with_location(self, location: SourceLocation) -> TranspileError
pub fn with_location(self, location: SourceLocation) -> TranspileError
Add location information to the error
Sourcepub fn with_context(self, ctx: impl Into<String>) -> TranspileError
pub fn with_context(self, ctx: impl Into<String>) -> TranspileError
Add context to the error
Sourcepub fn with_source(
self,
source: impl Error + Send + Sync + 'static,
) -> TranspileError
pub fn with_source( self, source: impl Error + Send + Sync + 'static, ) -> TranspileError
Add source error
Source§impl TranspileError
impl TranspileError
Sourcepub fn backend_error(msg: impl Into<String>) -> TranspileError
pub fn backend_error(msg: impl Into<String>) -> TranspileError
Create backend-specific error
Sourcepub fn transform_error(msg: impl Into<String>) -> TranspileError
pub fn transform_error(msg: impl Into<String>) -> TranspileError
Create transformation error
Sourcepub fn optimization_error(msg: impl Into<String>) -> TranspileError
pub fn optimization_error(msg: impl Into<String>) -> TranspileError
Create optimization error
Trait Implementations§
Source§impl Debug for TranspileError
impl Debug for TranspileError
Source§impl Display for TranspileError
impl Display for TranspileError
Source§impl Error for TranspileError
impl Error for TranspileError
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
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<Error> for TranspileError
Convert anyhow errors to TranspileError
impl From<Error> for TranspileError
Convert anyhow errors to TranspileError
Source§fn from(err: Error) -> TranspileError
fn from(err: Error) -> TranspileError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for TranspileError
impl !RefUnwindSafe for TranspileError
impl Send for TranspileError
impl Sync for TranspileError
impl Unpin for TranspileError
impl !UnwindSafe for TranspileError
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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