Skip to main content

Singleton

Trait Singleton 

Source
pub trait Singleton {
    // Required method
    fn instance() -> &'static Self;
}

Required Methods§

Source

fn instance() -> &'static Self

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Singleton for ()

Source§

fn instance() -> &'static Self

Implementors§

Source§

impl<C: Construct + 'static> Singleton for Constructor<C>

Source§

impl<M> Singleton for NothingProps<M>