I have a boxed trait object; I was wondering if, in any way, this can be passed to a method with a generic type bound:
trait Trait {
fn tmethod(&self) {
println!("hello");
}
}
impl Trait for Vec<i32> {}
fn call_tmethod<T: Trait>(t: T) {
t.tmethod();
}
fn main() {
let obj: Box<dyn Trait> = Box::new(vec![0]);
call_tmethod(obj);
}