I am having trouble using a function that takes a trait bound as a parameter. I have implemented a trait for another trait.
The function is define like
fn update_last_read_time<T: UniqueNamespace>(point: T) {
let unique_id = point.get_unique_namespace(true).expect("get_unique_namespace failed");
}
but I am getting the error
update_last_read_time(point);
| --------------------- ^^^^^ the trait `UniqueNamespace` is not implemented for `Box<TestPoint>`
| |
| required by a bound introduced by this call
|
= help: the trait `UniqueNamespace` is implemented for `(dyn Point + 'static)`
note: required by a bound in `update_last_read_time`
I thought I could pass a Box of a dynamic trait and it would work ?
I am not sure where 'static fits in which is my issue I think.
Test case is at