Skip to main content

ExecutionError

Enum ExecutionError 

Source
pub enum ExecutionError<Address>
where Address: Copy,
{
Show 15 variants UnalignedInstruction { address: PackedAddress<Address>, }, OutOfBoundsRead { address: PackedAddress<u64>, }, OutOfBoundsWrite { address: PackedAddress<u64>, }, MisalignedRead { address: PackedAddress<u64>, }, MisalignedWrite { address: PackedAddress<u64>, }, MisalignedAtomic { address: PackedAddress<u64>, }, EcallUnsupported { address: PackedAddress<Address>, }, IllegalInstruction { address: PackedAddress<Address>, }, CsrReadOnly { csr_index: u16, }, CsrIllegalRead { csr_index: u16, }, CsrIllegalWrite { csr_index: u16, }, CsrUnknown { csr_index: u16, }, CsrInsufficientPrivilege { csr_index: u16, required: PrivilegeLevel, current: PrivilegeLevel, }, UnsupportedPlatform, Custom([u8; 8]),
}
Expand description

Execution errors.

The variants of VirtualMemoryError and CsrError are inlined here rather than nested. Nesting cost an extra discriminant per level, which made this type 24 bytes; flattened it is 16, which is what lets Result<_, ExecutionError> be returned in registers instead of through a hidden out-pointer. From implementations for all three are provided, so ? on them keeps working unchanged.

Variants§

§

UnalignedInstruction

Unaligned instruction

Fields

§address: PackedAddress<Address>

Address of the unaligned instruction fetch

§

OutOfBoundsRead

Out-of-bounds read

Fields

§address: PackedAddress<u64>

Address of the out-of-bounds read

§

OutOfBoundsWrite

Out-of-bounds write

Fields

§address: PackedAddress<u64>

Address of the out-of-bounds write

§

MisalignedRead

Misaligned read from an instruction that requires natural alignment (e.g. lr), unlike ordinary loads

Fields

§address: PackedAddress<u64>

Address of the misaligned read

§

MisalignedWrite

Misaligned write from an instruction that requires natural alignment (e.g. sc), unlike ordinary stores

Fields

§address: PackedAddress<u64>

Address of the misaligned write

§

MisalignedAtomic

Misaligned atomic access (e.g. AMO) whose accessed bytes are not all within the same misaligned atomicity granule, unlike an ordinary misaligned read or write

Fields

§address: PackedAddress<u64>

Address of the misaligned atomic access

§

EcallUnsupported

Unsupported ecall instruction

Fields

§address: PackedAddress<Address>

Address of the unsupported instruction

§

IllegalInstruction

Unimplemented/illegal instruction

Fields

§address: PackedAddress<Address>

Address of the unimp instruction

§

CsrReadOnly

Read only CSR

Fields

§csr_index: u16

Index of CSR where write was attempted

§

CsrIllegalRead

Illegal read access

Fields

§csr_index: u16

Index of the accessed CSR

§

CsrIllegalWrite

Illegal write access

Fields

§csr_index: u16

Index of the accessed CSR

§

CsrUnknown

Unknown CSR

Fields

§csr_index: u16

Index of the accessed CSR

§

CsrInsufficientPrivilege

Insufficient privilege level

Fields

§csr_index: u16

Index of the accessed CSR

§required: PrivilegeLevel

Required privilege level

§current: PrivilegeLevel

Current privilege level

§

UnsupportedPlatform

Threaded execution is not supported on this platform.

See OpaqueThreadedExecutionResult::platform_supported() for what makes a platform unsupported and why the answer is a run-time one.

§

Custom([u8; 8])

Custom error

Trait Implementations§

Source§

impl<Address> Debug for ExecutionError<Address>
where Address: Copy + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Address> Display for ExecutionError<Address>
where Address: Copy, PackedAddress<Address>: Display + LowerHex,

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Address> Error for ExecutionError<Address>
where Address: Copy, Self: Debug + Display,

1.30.0 · Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl<Address> From<CsrError> for ExecutionError<Address>
where Address: Copy,

Source§

fn from(value: CsrError) -> Self

Converts to this type from the input type.
Source§

impl<Reg> From<ExecutionError<<Reg as Register>::Type>> for ExecutionResult<Reg>
where Reg: Register,

Source§

fn from(error: ExecutionError<Reg::Type>) -> Self

Converts to this type from the input type.
Source§

impl<Address> From<VirtualMemoryError> for ExecutionError<Address>
where Address: Copy,

Source§

fn from(value: VirtualMemoryError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<Address> Freeze for ExecutionError<Address>
where PackedAddress<Address>: Freeze,

§

impl<Address> RefUnwindSafe for ExecutionError<Address>
where PackedAddress<Address>: RefUnwindSafe,

§

impl<Address> Send for ExecutionError<Address>
where PackedAddress<Address>: Send,

§

impl<Address> Sync for ExecutionError<Address>
where PackedAddress<Address>: Sync,

§

impl<Address> Unpin for ExecutionError<Address>
where PackedAddress<Address>: Unpin,

§

impl<Address> UnsafeUnpin for ExecutionError<Address>
where PackedAddress<Address>: UnsafeUnpin,

§

impl<Address> UnwindSafe for ExecutionError<Address>
where PackedAddress<Address>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.