/// Inserts a value by a type in the [State].
Inserts a value by a type in the [State].
Inserts a value by a type in the [ State ] .
pub async fn insert<T>(&self, value: T) -> Option<T>
    where
        T: Send + Sync + 'static,
    {
        self.0
            .write()
            .await
            .insert(TypeId::of::<T>(), Box::new(value))
            .and_then(|value| value.downcast::<T>().ok())
            .map(|value| *value)
    }
pub async fn insert < T > ( & self , value : T ) -> Option < T > where T : Send + Sync + ' static , { self . 0 . write ( ) . await . insert ( TypeId :: of :: < T > ( ) , Box :: new ( value ) ) . and_then ( | value | value . downcast :: < T > ( ) . ok ( ) ) . map ( | value | * value ) }
Inserts a value by a type in the [State].
Inserts a value by a type in the [ State ] .
&self
value
T