pub struct CallFrame { /* private fields */ }
Expand description
Call frame representation in the VM stack.
https://github.com/FuelLabs/fuel-specs/blob/master/src/vm/index.md#call-frames
Implementations§
source§impl CallFrame
impl CallFrame
sourcepub const fn new(
to: ContractId,
asset_id: AssetId,
registers: [Word; 64],
code_size: Word,
a: Word,
b: Word
) -> Self
pub const fn new( to: ContractId, asset_id: AssetId, registers: [Word; 64], code_size: Word, a: Word, b: Word ) -> Self
Create a new call frame.
sourcepub const fn contract_id_offset() -> usize
pub const fn contract_id_offset() -> usize
Start of the contract id offset from the beginning of the call frame.
sourcepub const fn asset_id_offset() -> usize
pub const fn asset_id_offset() -> usize
Start of the asset id offset from the beginning of the call frame.
sourcepub const fn registers_offset() -> usize
pub const fn registers_offset() -> usize
Start of the registers offset from the beginning of the call frame.
sourcepub const fn code_size_offset() -> usize
pub const fn code_size_offset() -> usize
Start of the code size offset from the beginning of the call frame.
sourcepub const fn a_offset() -> usize
pub const fn a_offset() -> usize
Start of the a
argument offset from the beginning of the call frame.
sourcepub const fn b_offset() -> usize
pub const fn b_offset() -> usize
Start of the b
argument offset from the beginning of the call frame.
sourcepub const fn serialized_size() -> usize
pub const fn serialized_size() -> usize
Size of the call frame in bytes.
sourcepub const fn to(&self) -> &ContractId
pub const fn to(&self) -> &ContractId
Called contract id.
sourcepub fn code_size_padding(&self) -> Word
pub fn code_size_padding(&self) -> Word
Padding to the next word boundary.
sourcepub fn total_code_size(&self) -> Word
pub fn total_code_size(&self) -> Word
Total code size including padding.
sourcepub fn context_gas(&self) -> Word
pub fn context_gas(&self) -> Word
Gas context prior to the called execution.
sourcepub fn context_gas_mut(&mut self) -> &mut Word
pub fn context_gas_mut(&mut self) -> &mut Word
Returns the mutable value of the context gas for this call frame.
sourcepub fn global_gas_mut(&mut self) -> &mut Word
pub fn global_gas_mut(&mut self) -> &mut Word
Returns the mutable value of the global gas for this call frame.
Trait Implementations§
source§impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
source§fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
source§impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
source§fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
source§impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
§type Type = ContractId
type Type = ContractId
source§fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
source§impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
source§fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
source§impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
source§fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
source§impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
impl MemLocType<{ <$o as $crate::MemLayout>::LAYOUT.$field.addr() }, { <$o as $crate::MemLayout>::LAYOUT.$field.size() }> for CallFrame
source§fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
fn layout(loc: MemLoc<ADDR, SIZE>) -> LayoutType<ADDR, SIZE, Self>
source§impl PartialEq<CallFrame> for CallFrame
impl PartialEq<CallFrame> for CallFrame
source§impl Read for CallFrame
impl Read for CallFrame
source§fn read(&mut self, buf: &mut [u8]) -> Result<usize>
fn read(&mut self, buf: &mut [u8]) -> Result<usize>
1.36.0 · source§fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
fn read_vectored(&mut self, bufs: &mut [IoSliceMut<'_>]) -> Result<usize, Error>
read
, except that it reads into a slice of buffers. Read moresource§fn is_read_vectored(&self) -> bool
fn is_read_vectored(&self) -> bool
can_vector
)1.0.0 · source§fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
fn read_to_end(&mut self, buf: &mut Vec<u8, Global>) -> Result<usize, Error>
buf
. Read more1.0.0 · source§fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
fn read_to_string(&mut self, buf: &mut String) -> Result<usize, Error>
buf
. Read more1.6.0 · source§fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
fn read_exact(&mut self, buf: &mut [u8]) -> Result<(), Error>
buf
. Read moresource§fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf(&mut self, buf: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)source§fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
fn read_buf_exact(&mut self, cursor: BorrowedCursor<'_>) -> Result<(), Error>
read_buf
)cursor
. Read more1.0.0 · source§fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere Self: Sized,
Read
. Read moresource§impl SizedBytes for CallFrame
impl SizedBytes for CallFrame
source§fn serialized_size(&self) -> usize
fn serialized_size(&self) -> usize
source§impl Write for CallFrame
impl Write for CallFrame
source§fn write(&mut self, buf: &[u8]) -> Result<usize>
fn write(&mut self, buf: &[u8]) -> Result<usize>
source§fn flush(&mut self) -> Result<()>
fn flush(&mut self) -> Result<()>
source§fn is_write_vectored(&self) -> bool
fn is_write_vectored(&self) -> bool
can_vector
)1.0.0 · source§fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
fn write_all(&mut self, buf: &[u8]) -> Result<(), Error>
source§fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
fn write_all_vectored(&mut self, bufs: &mut [IoSlice<'_>]) -> Result<(), Error>
write_all_vectored
)impl Eq for CallFrame
impl StructuralEq for CallFrame
impl StructuralPartialEq for CallFrame
Auto Trait Implementations§
impl RefUnwindSafe for CallFrame
impl Send for CallFrame
impl Sync for CallFrame
impl Unpin for CallFrame
impl UnwindSafe for CallFrame
Blanket Implementations§
source§impl<T> AnyDebug for Twhere
T: Any + Debug,
impl<T> AnyDebug for Twhere T: Any + Debug,
source§fn as_any_ref(&self) -> &(dyn Any + 'static)
fn as_any_ref(&self) -> &(dyn Any + 'static)
Any
.