Skip to main content

previous_step

Function previous_step 

Source
pub fn previous_step<T>(previous: Previous<T>, current: T) -> Option<T>
where T: Clone + PartialEq + Debug + 'static,
Expand description

Records current against the supplied tracker and returns the snapshot of what was previously recorded.

Convenience wrapper used by component-level consumers that want the “compute previous” + “record new current” steps glued together. Returns None on the first call (no prior value exists yet).

§Arguments

  • Previous<T> - The tracker obtained from use_previous().
  • T - The current value to record.

§Returns

  • Option<T> - The value that was recorded on the previous call, or None if no prior value exists.