Struct fuel_vm::constraints::CheckedMemConstLen
source · pub struct CheckedMemConstLen<const LEN: usize>(_);
Expand description
A range of memory that has been checked that it fits into the VM memory.
Implementations§
source§impl<const LEN: usize> CheckedMemConstLen<LEN>
impl<const LEN: usize> CheckedMemConstLen<LEN>
sourcepub fn new(address: Word) -> Result<Self, RuntimeError>
pub fn new(address: Word) -> Result<Self, RuntimeError>
Create a new const sized memory range.
sourcepub fn new_with_constraint(
address: Word,
constraint: Range<Word>
) -> Result<Self, RuntimeError>
pub fn new_with_constraint( address: Word, constraint: Range<Word> ) -> Result<Self, RuntimeError>
Create a new memory range with a custom constraint.
Panics if constraints end > VM_MAX_RAM
.
Methods from Deref<Target = CheckedMemRange>§
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<const LEN: usize> Clone for CheckedMemConstLen<LEN>
impl<const LEN: usize> Clone for CheckedMemConstLen<LEN>
source§fn clone(&self) -> CheckedMemConstLen<LEN>
fn clone(&self) -> CheckedMemConstLen<LEN>
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