Reputation: 564
in Rocket documentation I found this construction
request.guard::<&State<MyConfig>>().await
I understand await and &
but this func::<type>()
part is completely different from what I have seen in other mainstream languages func()
like C++, C#, Java, python...
probably best answer would be to point me to the right reading material about it because it's not framework specific
Upvotes: 1
Views: 131
Reputation: 64
It is called the turbofish, and is used for generics - and sometimes used when the Rust compiler cannot infer the type of some variable, for specifying the concrete type of that variable.
See non-operator symbols on the Rust Book for more information.
Upvotes: 5