#[repr(C)]pub struct ExecBuffer {
pub gas_left: i64,
pub syscall_no: u32,
pub _pad: u32,
pub a0: u64,
pub a1: u64,
pub a2: u64,
pub a3: u64,
pub a4: u64,
pub a5: u64,
}Expand description
Buffer shared between runtime and executor for passing syscall data across the host function boundary.
The runtime allocates this on its stack and passes it via pointer.
The host fills it in when returning from VirtT::run.
Fields§
§gas_left: i64Gas remaining after the execution step.
syscall_no: u32The syscall number (only meaningful when the status is ExecStatus::Syscall).
_pad: u32Padding to maintain alignment after syscall_no.
a0: u64Syscall register arguments a0-a5 (only meaningful for ExecStatus::Syscall).
a1: u64§a2: u64§a3: u64§a4: u64§a5: u64Implementations§
Source§impl ExecBuffer
impl ExecBuffer
Sourcepub fn from_outcome(outcome: &ExecOutcome) -> Self
pub fn from_outcome(outcome: &ExecOutcome) -> Self
Populate this buffer from an ExecOutcome.
Sourcepub fn into_outcome(self, status: ExecStatus) -> ExecOutcome
pub fn into_outcome(self, status: ExecStatus) -> ExecOutcome
Decode a status byte and this buffer into an ExecOutcome.
Trait Implementations§
Source§impl AsMut<[u8]> for ExecBuffer
impl AsMut<[u8]> for ExecBuffer
Source§impl AsRef<[u8]> for ExecBuffer
impl AsRef<[u8]> for ExecBuffer
Source§impl Debug for ExecBuffer
impl Debug for ExecBuffer
Source§impl Default for ExecBuffer
impl Default for ExecBuffer
Source§fn default() -> ExecBuffer
fn default() -> ExecBuffer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ExecBuffer
impl RefUnwindSafe for ExecBuffer
impl Send for ExecBuffer
impl Sync for ExecBuffer
impl Unpin for ExecBuffer
impl UnsafeUnpin for ExecBuffer
impl UnwindSafe for ExecBuffer
Blanket Implementations§
Source§impl<T, U> AsByteSlice<T> for U
impl<T, U> AsByteSlice<T> for U
fn as_byte_slice(&self) -> &[u8] ⓘ
Source§impl<T, U> AsMutByteSlice<T> for U
impl<T, U> AsMutByteSlice<T> for U
fn as_mut_byte_slice(&mut self) -> &mut [u8] ⓘ
Source§impl<U> AsMutSliceOf for U
impl<U> AsMutSliceOf for U
fn as_mut_slice_of<T>(&mut self) -> Result<&mut [T], Error>where
T: FromByteSlice,
Source§impl<U> AsSliceOf for U
impl<U> AsSliceOf for U
fn as_slice_of<T>(&self) -> Result<&[T], Error>where
T: FromByteSlice,
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