Link from the rust global docs to the singleton langref

This commit is contained in:
Simon Hausmann 2021-08-27 11:50:20 +02:00 committed by Olivier Goffart
parent 85259b21b6
commit c7ef3e0fb9

View file

@ -451,6 +451,8 @@ pub fn invoke_from_event_loop(func: impl FnOnce() + Send + 'static) {
/// // alternate way to access the global:
/// Palette::get(&app).set_foreground_color(sixtyfps::Color::from_rgb_u8(255, 255, 255));
/// ```
///
/// See also the [language reference for globals](docs/langref/index.html#global-singletons) for more information.
pub trait Global<'a, Component> {
/// Returns a reference that's tied to the life time of the provided component.
fn get(component: &'a Component) -> Self;