michis_collection_cursor 0.1.3

A cursor which wraps an indexable collection, providing a movable position which points to an index of the collection. Useful for things like history, undo-redo systems, or timelines.
Documentation
extern crate alloc;

use alloc::{collections::VecDeque, vec::Vec};

use crate::{IndexableCollection, IndexableCollectionMut, IndexableCollectionResizable};

impl<T> IndexableCollection for Vec<T> {
	type Item = T;
	forward_indexable!();
}

impl<T> IndexableCollectionMut for Vec<T> {
	forward_mutable!();
}

impl<T> IndexableCollectionResizable for Vec<T> {
	forward_resizable!(check_len_on_remove = true);
}

impl<T> IndexableCollection for VecDeque<T> {
	type Item = T;
	forward_indexable!();
}

impl<T> IndexableCollectionMut for VecDeque<T> {
	forward_mutable!();
}

impl<T> IndexableCollectionResizable for VecDeque<T> {
	forward_resizable!(check_len_on_remove = false);
}