orx_selfref_col/variant.rs
1use crate::Refs;
2
3/// Variant defining `SelfRefCol` specifications.
4pub trait Variant: Sized {
5 /// Elements of the collection.
6 type Item;
7
8 /// The way the previous node references will be stored.
9 /// * `RefsNone` if there is no reference.
10 /// * `RefsSingle` if there is zero or one reference.
11 /// * `RefsArray` if there is a constant number of references.
12 /// * `RefsVec` if there is a dynamic number of references.
13 type Prev: Refs;
14
15 /// The way the next node references will be stored.
16 /// * `RefsNone` if there is no reference.
17 /// * `RefsSingle` if there is zero or one reference.
18 /// * `RefsArray` if there is a constant number of references.
19 /// * `RefsVec` if there is a dynamic number of references.
20 type Next: Refs;
21
22 /// The way the ends of the collection will be stored,
23 /// such as the front of a linked list or root of a tree.
24 /// * `RefsNone` if there is no reference.
25 /// * `RefsSingle` if there is zero or one reference.
26 /// * `RefsArray` if there is a constant number of references.
27 /// * `RefsVec` if there is a dynamic number of references.
28 type Ends: Refs;
29}