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 moresource§impl<const LEN: usize> Deref for CheckedMemConstLen<LEN>
impl<const LEN: usize> Deref for CheckedMemConstLen<LEN>
Auto Trait Implementations§
impl<const LEN: usize> RefUnwindSafe for CheckedMemConstLen<LEN>
impl<const LEN: usize> Send for CheckedMemConstLen<LEN>
impl<const LEN: usize> Sync for CheckedMemConstLen<LEN>
impl<const LEN: usize> Unpin for CheckedMemConstLen<LEN>
impl<const LEN: usize> UnwindSafe for CheckedMemConstLen<LEN>
Blanket Implementations§
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