Trait Foo : 'static {}

Hello,
Newbie question . What does it mean by

trait Foo : 'static {
}

I've seen it in gtk-rs.
Thanks

1 Like

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

2 Likes

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.

2 Likes

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

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.