TraceImpl
Fully qualified path: openzeppelin_utils::structs::checkpoint::TraceImpl
pub impl TraceImpl of TraceTrait;
Impl functions
push
Pushes a (key, value) pair into a Trace so that it is stored as the checkpoint
and returns both the previous and the new value.
Fully qualified path: openzeppelin_utils::structs::checkpoint::TraceImpl::push
fn push(self: StoragePath<Mutable<Trace>>, key: u64, value: u256) -> (u256, u256)
upper_lookup
Returns the value in the last (most recent) checkpoint with the key lower than or equal to the search key, or zero if there is none.
Fully qualified path: openzeppelin_utils::structs::checkpoint::TraceImpl::upper_lookup
fn upper_lookup(self: StoragePath<Trace>, key: u64) -> u256
upper_lookup_recent
Returns the value in the last (most recent) checkpoint with key lower than or equal to the search key, or zero if there is none.
NOTE: This is a variant of upper_lookup that is optimised to
find “recent” checkpoints (checkpoints with high keys).
Fully qualified path: openzeppelin_utils::structs::checkpoint::TraceImpl::upper_lookup_recent
fn upper_lookup_recent(self: StoragePath<Trace>, key: u64) -> u256
latest
Returns the value in the most recent checkpoint, or zero if there are no checkpoints.
Fully qualified path: openzeppelin_utils::structs::checkpoint::TraceImpl::latest
fn latest(self: StoragePath<Trace>) -> u256
latest_checkpoint
Returns whether there is a checkpoint in the structure (i.e. it is not empty), and if so the key and value in the most recent checkpoint.
Fully qualified path: openzeppelin_utils::structs::checkpoint::TraceImpl::latest_checkpoint
fn latest_checkpoint(self: StoragePath<Trace>) -> (bool, u64, u256)
length
Returns the total number of checkpoints.
Fully qualified path: openzeppelin_utils::structs::checkpoint::TraceImpl::length
fn length(self: StoragePath<Trace>) -> u64
at
Returns the checkpoint at the given position.
Fully qualified path: openzeppelin_utils::structs::checkpoint::TraceImpl::at
fn at(self: StoragePath<Trace>, pos: u64) -> Checkpoint