zoumi
1
#[derive(Default, Debug)]
pub struct TypeMap<A: ?Sized = UnsafeAny>
where A: UnsafeAnyExt {
data: HashMap<TypeId, Box<A>>
}
The codes come from here: ironframework.io
I don't know why there is a "=" between "?Sized" and "UnsafeAny".
Associated type???
1 Like
Default. A
is any type (including ones that don't implement Sized
), and defaults to UnsafeAny
if not otherwise specified or constrained.
Edit: I'd link you to where it's explained in the book, but it doesn't appear to be.
1 Like
zoumi
4
Nice answers! Thank you! @DanielKeep @vitalyd