pub trait FromWord: OnlyPrimitives {
// Required methods
fn to_word(&self) -> U256;
fn from_word(word: U256) -> Result<Self>
where Self: Sized;
}Expand description
Trait for primitive types that fit into a single EVM storage slot.
Implementations must produce right-aligned U256 values (data in low bytes) to match EVM storage slot layout expectations.
§Warning
Round-trip conversions must preserve data: from_word(to_word(x)) == x