What is `<x as y>::Name` for?

In gfx examples they type a parameter using &mut <back::Backend as hal::Backend>::Surface. Is &mut back::Backend::Surface equivalent or any difference?

1 Like

<Type as Trait> is used to specify that you’re specifically referring to the members of Trait as implemented for Type. Normally, the compiler works this out itself. You need to write this out when the compiler complains that it doesn’t know what you’re talking about because it got confused somewhere.

2 Likes