[solved]What does "struct TypeMap<A: ?Sized = UnsafeAny>" mean?

#[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

Default type parameter: https://github.com/rust-lang/rfcs/blob/master/text/0213-defaulted-type-params.md

1 Like

Nice answers! Thank you! @DanielKeep @vitalyd