[][src]Function glsp::add_rglobal

pub fn add_rglobal<T>(rglobal: T) where
    T: RGlobal

Registers global data.

RGlobal types are singletons: if the active Runtime already contains a global of type T, this function will panic.

When the active Runtime is dropped, each of its globals will be dropped in the reverse order that they were registered.

Once registered, it's possible to remove a global from the Runtime by calling glsp::take_rglobal, or borrow it by calling the associated functions T::borrow and T::borrow_mut.