V
Size: a a a
V
В
AZ
OA
В
AZ
В
Box<dyn Node<T>> -> T -> Box<dyn Node<T>> то снимаю шляпуAZ
V
В
V
V
impl<T> Node<T> for Nil {}AZ
В
HList X)В
Cons<i32, _> и Cons<i64, _>V
AZ
Cons<i32, _> и Cons<i64, _>AZ
AZ
В
trait Node {
type Item;
}
struct Nil<T>(PhantomData<T>);
impl<T> Node for Nil<T> {
type Item = T;
}
struct Cons<N: Node> {
head: N::Item,
tail: N,
}
impl<N: Node> Node for Cons<N> {
type Item = N::Item;
}
(playground)