3 ms·
"Generic Associated Type". Explained in other terms, a generic is just a parameter for types, analogous to how `x` is a value parameter for the function call `
by kibwen 4y ago
"Generic Associated Type".
Explained in other terms, a generic is just a parameter for types, analogous to how `x` is a value parameter for the function call `foo(x)`.
Meanwhile, an associated type is just a type alias that's associated with a trait (a trait is a class, but with no state), similar to how traits can have associated functions (which are also known as "methods").
GATs, then, "just" let you use generics in associated types, which was previously unsupported in Rust.