pub struct StorageKeySpec {
pub offset: usize,
pub len: usize,
}Expand description
Specification for extracting storage keys from calldata.
Key specs enable dynamic slot extraction at runtime. For example, extracting an account ID from calldata to compute a balance slot.
§Example
ⓘ
// Extract 32-byte account ID starting at byte 4 of calldata
let spec = StorageKeySpec { offset: 4, len: 32 };Fields§
§offset: usizeByte offset in calldata where the key starts.
len: usizeLength of the key in bytes.
Trait Implementations§
Source§impl Clone for StorageKeySpec
impl Clone for StorageKeySpec
Source§fn clone(&self) -> StorageKeySpec
fn clone(&self) -> StorageKeySpec
Returns a duplicate 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 StorageKeySpec
impl Debug for StorageKeySpec
Source§impl Hash for StorageKeySpec
impl Hash for StorageKeySpec
Source§impl Ord for StorageKeySpec
impl Ord for StorageKeySpec
Source§fn cmp(&self, other: &StorageKeySpec) -> Ordering
fn cmp(&self, other: &StorageKeySpec) -> 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 StorageKeySpec
impl PartialEq for StorageKeySpec
Source§impl PartialOrd for StorageKeySpec
impl PartialOrd for StorageKeySpec
impl Copy for StorageKeySpec
impl Eq for StorageKeySpec
impl StructuralPartialEq for StorageKeySpec
Auto Trait Implementations§
impl Freeze for StorageKeySpec
impl RefUnwindSafe for StorageKeySpec
impl Send for StorageKeySpec
impl Sync for StorageKeySpec
impl Unpin for StorageKeySpec
impl UnsafeUnpin for StorageKeySpec
impl UnwindSafe for StorageKeySpec
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