Skip to main content

Packable

Trait Packable 

Source
pub trait Packable: FromWord + StorableType { }
Expand description

Trait for types that can be packed into EVM storage slots.

This trait is sealed - it can only be implemented within this crate for primitive types that fit in a single U256 word.

§Usage

Packable is used by the storage packing system to efficiently pack multiple small values into a single 32-byte storage slot.

§Warning

IS_PACKABLE must be true for the implementing type (enforced at compile time)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Packable for bool

Source§

impl Packable for i8

Source§

impl Packable for i16

Source§

impl Packable for i32

Source§

impl Packable for i64

Source§

impl Packable for i128

Source§

impl Packable for u8

Source§

impl Packable for u16

Source§

impl Packable for u32

Source§

impl Packable for u64

Source§

impl Packable for u128

Source§

impl Packable for Address

Source§

impl Packable for FixedBytes<1usize>

Source§

impl Packable for FixedBytes<2usize>

Source§

impl Packable for FixedBytes<3usize>

Source§

impl Packable for FixedBytes<4usize>

Source§

impl Packable for FixedBytes<5usize>

Source§

impl Packable for FixedBytes<6usize>

Source§

impl Packable for FixedBytes<7usize>

Source§

impl Packable for FixedBytes<8usize>

Source§

impl Packable for FixedBytes<9usize>

Source§

impl Packable for FixedBytes<10usize>

Source§

impl Packable for FixedBytes<11usize>

Source§

impl Packable for FixedBytes<12usize>

Source§

impl Packable for FixedBytes<13usize>

Source§

impl Packable for FixedBytes<14usize>

Source§

impl Packable for FixedBytes<15usize>

Source§

impl Packable for FixedBytes<16usize>

Source§

impl Packable for FixedBytes<17usize>

Source§

impl Packable for FixedBytes<18usize>

Source§

impl Packable for FixedBytes<19usize>

Source§

impl Packable for FixedBytes<20usize>

Source§

impl Packable for FixedBytes<21usize>

Source§

impl Packable for FixedBytes<22usize>

Source§

impl Packable for FixedBytes<23usize>

Source§

impl Packable for FixedBytes<24usize>

Source§

impl Packable for FixedBytes<25usize>

Source§

impl Packable for FixedBytes<26usize>

Source§

impl Packable for FixedBytes<27usize>

Source§

impl Packable for FixedBytes<28usize>

Source§

impl Packable for FixedBytes<29usize>

Source§

impl Packable for FixedBytes<30usize>

Source§

impl Packable for FixedBytes<31usize>

Source§

impl Packable for I8

Source§

impl Packable for I16

Source§

impl Packable for I32

Source§

impl Packable for I64

Source§

impl Packable for I128

Source§

impl Packable for U8

Source§

impl Packable for U16

Source§

impl Packable for U32

Source§

impl Packable for U64

Source§

impl Packable for U128

Implementors§