Let's say we have a trait:
trait Thing<T> {...}
Is there a way to use that as a trait bound elsewhere? Something like:
struct ThingProcessor<T, S: Thing<T>> {...}
#rustlang
Replying to @cbeckpdx
You're looking for PhantomData, which is a zero size type you can use to have a field for a value of a generic parameter which you need to have as part of the type, but wouldn't otherwise use
7:05 PM - 6 Jan 2020
0 replies
0 retweets
2 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.