pub struct Error { /* private fields */ }Implementations§
Source§impl Error
impl Error
pub fn kind(&self) -> &ErrorKind
pub fn into_kind(self) -> ErrorKind
pub fn suggest_location(self, absolute_program_counter: usize) -> Error
Sourcepub fn locate(
&self,
debug_info: &[u8],
) -> Result<Option<(usize, usize)>, DebugInfoError>
pub fn locate( &self, debug_info: &[u8], ) -> Result<Option<(usize, usize)>, DebugInfoError>
Converts the error’s location hint into the source code span it originated from.
This may result in None–not all errors have locations.
§Errors
Returns a DebugInfoError if the debug info is malformed.
The reported position of this error may be trusted and will never be the source of an error.
Source§impl Error
impl Error
pub fn type_error(value: &Value<'_>, ty: &ComplexType) -> Error
pub fn index_not_found(container: &Value<'_>, index: &Value<'_>) -> Error
pub fn expected_integers(l: &Value<'_>, r: &Value<'_>) -> Error
pub fn expected_tuple(i: &Value<'_>) -> Error
pub fn expected_named_tuple(i: &Value<'_>) -> Error
pub fn expected_function(function: &Value<'_>) -> Error
pub fn incomparable_values(l: &Value<'_>, r: &Value<'_>) -> Error
pub fn expected_enum_variant(i: &Value<'_>) -> Error
pub fn expected_enum_type(i: &Value<'_>) -> Error
pub fn expected_option(i: &Value<'_>) -> Error
pub fn expected_reference(i: &Value<'_>) -> Error
pub fn other(e: impl Into<Error>) -> Error
pub fn custom(message: &'static str) -> Error
Trait Implementations§
Source§impl Error for Error
impl Error for Error
1.30.0§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§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<InvalidBytecode> for Error
impl From<InvalidBytecode> for Error
Source§fn from(e: InvalidBytecode) -> Error
fn from(e: InvalidBytecode) -> Error
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Error
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more