Files
oak-gpui/crates
Marshall Bowers d633a0da78 gpui: Fix Global trait (#11187)
This PR restores the `Global` trait's status as a marker trait.

This was the original intent from #7095, when it was added, that had
been lost in #9777.

The purpose of the `Global` trait is to statically convey what types can
and can't be accessed as `Global` state, as well as provide a way of
restricting access to said globals.

For example, in the case of the `ThemeRegistry` we have a private
`GlobalThemeRegistry` that is marked as `Global`:
https://github.com/zed-industries/zed/blob/91b3c24ed35d58438ae33970f07d1ff01d3acfc7/crates/theme/src/registry.rs#L25-L34

We're then able to permit reading the `ThemeRegistry` from the
`GlobalThemeRegistry` via a custom getter, while still restricting which
callers are able to mutate the global:
https://github.com/zed-industries/zed/blob/91b3c24ed35d58438ae33970f07d1ff01d3acfc7/crates/theme/src/registry.rs#L46-L61

Release Notes:

- N/A
2024-04-29 16:37:37 -04:00
..
2024-04-23 15:33:09 -06:00
2024-04-23 15:33:09 -06:00
2024-04-23 13:31:21 -04:00
2024-03-28 18:32:11 +01:00
2024-04-11 15:36:35 -06:00
2024-04-26 13:25:25 -06:00
2024-03-20 15:52:02 +01:00
2024-04-29 16:37:37 -04:00
2024-03-11 10:45:57 +01:00
2024-03-26 16:10:09 -07:00
2024-04-26 13:25:25 -06:00
2024-04-26 13:25:25 -06:00
2024-04-29 16:37:37 -04:00
2024-04-23 15:33:09 -06:00
2024-03-14 17:05:07 -04:00
2024-04-11 23:09:12 +02:00
2024-04-29 16:37:37 -04:00
2024-04-15 14:21:52 +02:00
2024-04-29 15:34:34 +02:00