pub struct FatPointer {
pub offset: u32,
pub memory_page: u32,
pub start: u32,
pub length: u32,
}
Fields§
§offset: u32
§memory_page: u32
§start: u32
§length: u32
Implementations§
Source§impl FatPointer
impl FatPointer
pub const FAT_POINTER_PACKED_WIDTH: u32 = 128u32
pub const fn empty() -> Self
pub const fn from_u256(value: U256) -> Self
pub fn validate(self, is_fresh: bool) -> FatPointerValidationException
Sourcepub const fn validate_in_bounds(&self) -> bool
pub const fn validate_in_bounds(&self) -> bool
IMPORTANT: when we create a pointer in VM using checked routine
we know that start
and length
form a good combination in terms of no overflows
and spanning only addressable region, so we only need to check that offset
< length
Sourcepub const fn validate_as_slice(&self) -> bool
pub const fn validate_as_slice(&self) -> bool
We allow to pass empty (offset == length) slices in Far call / Ret
Sourcepub const fn is_trivial(&self) -> bool
pub const fn is_trivial(&self) -> bool
special case when we supply empty slice, that is formally NOT addressable
pub const fn to_u256(self) -> U256
Trait Implementations§
Source§impl Clone for FatPointer
impl Clone for FatPointer
Source§fn clone(&self) -> FatPointer
fn clone(&self) -> FatPointer
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 Debug for FatPointer
impl Debug for FatPointer
Source§impl Hash for FatPointer
impl Hash for FatPointer
Source§impl Ord for FatPointer
impl Ord for FatPointer
Source§fn cmp(&self, other: &FatPointer) -> Ordering
fn cmp(&self, other: &FatPointer) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for FatPointer
impl PartialEq for FatPointer
Source§impl PartialOrd for FatPointer
impl PartialOrd for FatPointer
impl Copy for FatPointer
impl Eq for FatPointer
impl StructuralPartialEq for FatPointer
Auto Trait Implementations§
impl Freeze for FatPointer
impl RefUnwindSafe for FatPointer
impl Send for FatPointer
impl Sync for FatPointer
impl Unpin for FatPointer
impl UnwindSafe for FatPointer
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