Trait write_fonts::util::WrappingGet
source · pub trait WrappingGet<T> {
// Required methods
fn wrapping_next(&self, idx: usize) -> &T;
fn wrapping_prev(&self, idx: usize) -> &T;
}Expand description
Read next or previous, wrapping if we go out of bounds.
This is particularly useful when porting from Python where reading idx - 1, with -1 meaning last, is common.