address_of

Function address_of 

Source
pub fn address_of<T>() -> Option<NonNull<T>>
where T: FromSingleton + Sized,
Expand description

Returns a pointer to a singleton instance using Dantelion2 reflection. May return None if the singleton was not found.

This function is safe, but it may not find all singletons if it is called before Dantelion2 reflection is initialized by the process.

Ensure the return value is convertible to a reference before dereferencing it.