Ref

Type Alias Ref 

Source
pub type Ref<T> = Arc<T>;
Expand description

A generic reference type that’s used as the default type for types with the singleton lifetime.

When the multithread feature is set, this defaults to std::sync::Arc. When the multithread feature is NOT set, this defaults to std::rc::Rc.

It’s advised to use Ref instead of the concrete type because it simplifies enabling multithread when required.

Aliased Type§

pub struct Ref<T> { /* private fields */ }

Trait Implementations§

Source§

impl<T: RegisterableSingleton> From<Singleton<T>> for Ref<T>

Source§

fn from(value: Singleton<T>) -> Self

Converts to this type from the input type.