Struct fuel_vm::constraints::CheckedMemRange
source · pub struct CheckedMemRange(_);
Expand description
A range of memory that has been checked that it fits into the VM memory.
Implementations§
source§impl CheckedMemRange
impl CheckedMemRange
sourcepub fn new_const<const SIZE: usize>(address: Word) -> Result<Self, RuntimeError>
pub fn new_const<const SIZE: usize>(address: Word) -> Result<Self, RuntimeError>
Create a new const sized memory range.
sourcepub fn new(address: Word, size: usize) -> Result<Self, RuntimeError>
pub fn new(address: Word, size: usize) -> Result<Self, RuntimeError>
Create a new memory range.
sourcepub fn new_with_constraint(
address: Word,
size: usize,
constraint: Range<Word>
) -> Result<Self, RuntimeError>
pub fn new_with_constraint( address: Word, size: usize, constraint: Range<Word> ) -> Result<Self, RuntimeError>
Create a new memory range with a custom constraint.
The min of the constraints end and VM_MAX_RAM
will be used.
sourcepub fn shrink_end(&mut self, by: usize)
pub fn shrink_end(&mut self, by: usize)
This function is safe because it is only used to shrink the range and worst case the range will be empty.
sourcepub fn grow_start(&mut self, by: usize)
pub fn grow_start(&mut self, by: usize)
This function is safe because it is only used to grow the range and worst case the range will be empty.
Trait Implementations§
source§impl Clone for CheckedMemRange
impl Clone for CheckedMemRange
source§fn clone(&self) -> CheckedMemRange
fn clone(&self) -> CheckedMemRange
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more