For example in raw_vec.rs:
pub struct RawVec<T, A: AllocRef = Global> {
ptr: Unique<T>,
cap: usize,
alloc: A,
}
I can see Global is a struct that implements AllocRef trait.
I'm surprised I can't find any explanation in rust books. I appreciate any links to docs on the topic.
If I had to guess it's a way to further constrain the impls that 'A' can take, but then why need 'A' generic type at all? It seems simpler to define the field alloc as Global. Again this is just a guess. Clarification appreciated.
Thanks!