I have a trait that has an assocated type Ctx
trait BarTrait {
type Ctx: PartialEq + Debug
....
}
and another trait that has an associated type Bar. Now I want to refer to FooTrait's associated type's associated type in a defined method (so BarTrait's Ctx type)
trait FooTrait {
type Bar: BarTrait;
fn load(ctx: Self::Bar::Ctx) -> Self;
}
When I compile this I get an error telling me to
help: use fully-qualified syntax: `<<Self as traits::FooTrait>::Bar as Trait>::Ctx`
However, when I do so, it then complains that Trait
is an undeclared type or module..
So How do I go about doing this?