michis_collection_cursor 0.1.1

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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use generic_array::{ArrayLength, GenericArray};

use crate::{IndexableCollection, IndexableCollectionMut};

impl<T, N: ArrayLength> IndexableCollection for GenericArray<T, N> {
	type Item = T;

	forward_indexable!(get_item);

	fn len(&self) -> usize {
		N::USIZE
	}
}

impl<T, N: ArrayLength> IndexableCollectionMut for GenericArray<T, N> {
	forward_mutable!();
}