Trait Foo : 'static {}

Newbie question . What does it mean by

trait Foo : 'static {

I've seen it in gtk-rs.

This means that any implementation of Foo can only hold static references.

1 Like

Or no references at all, to be clear. Generally T: 'static means T is not tied to any lifetime region so you can freely send it to anywhere.


Thanks now I understand.
Where do you find this information?

Once you have gone through the more introductory documentation. You get to the reference. trait bounds might be closing in on this. Going deeper in gaining knowledge are release notes, RFCs and more weekly. For the most obscure/extreme there is this forum pointing the way.

1 Like