If I have a trait like the following Foo trait
trait Foo: Bar {
type Account: SomeTrait;
}
That has a trait bound that requires Bar
trait Bar {
type UserId;
}
How can I request inside the Foo trait that this trait requires the UserId type inside the Bar trait to be u32?
Important note: I can't edit the Bar trait.
This can be specified as a named generic argument: Bar<UserId=u32>.
trait SomeTrait {}
trait Foo: Bar<UserId=u32> {
type Account: SomeTrait;
}
trait Bar {
type UserId;
}
See the playground.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With