pub fn event_absolute_position(len: usize, index: i32) -> Option<usize>
Expand description

Calculates the absolute position of the event. Accepts both positive and negative indexing.

Examples

use odra_utils::event_absolute_position;

assert_eq!(event_absolute_position(10, 0), Some(0));
assert_eq!(event_absolute_position(10, -1), Some(9));
assert_eq!(event_absolute_position(10, 10), None);