AssociatedTypes and function type constraints


#1

I have a trait object with an associated type

pub trait ProvideValue {
    type Lookup: ToString;
    fn value(&self, key: &Self::Lookup) -> String;
}

And a function which I am defining like so:

fn display_table<T,V>(keys: Vec<T>,json: Vec<V> )
where T: ToString,
          V: ProvideValue { ... }

T in addition to needing to implement ToString also needs to be the associated type Lookup for V. How do I express this?
I am getting the following error in the implementation of display_table

error: expected identifier, found `<`
  --> src/main.rs:39:10
   |
39 | where T: <V as foobar::ProvideValue>::Lookup+ToString,
   |          ^ expected identifier

Thanks


#2

V: ProvideValue<Lookup = T>


#3

thats exactly what I was looking for. Thanks!