pub trait HashedPostStateCursorValue: Copy {
type NonZero: Copy + Debug;
// Required method
fn into_option(self) -> Option<Self::NonZero>;
}Expand description
Trait for types that can be used with HashedPostStateCursor as a value.
This enables uniform handling of deletions across different wrapper types:
Option<Account>:Noneindicates deletionU256:U256::ZEROindicates deletion (maps toNone)
This design allows us to use U256::ZERO, rather than an Option, to indicate deletion for
storage (which maps cleanly to how changesets are stored in the DB) while not requiring two
different cursor implementations.
Required Associated Types§
Required Methods§
Sourcefn into_option(self) -> Option<Self::NonZero>
fn into_option(self) -> Option<Self::NonZero>
Returns Some(&NonZero) if the value is present, None if deleted.
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.