pub fn try_insert(&mut self, key: K, v: T) -> Option<&'a T::Ref> {
		self.0.try_insert(key, v)
			.map(|ptr| {
				// safe because ref does not live longer than HashMapOwner
				unsafe { &*ptr }
			})
	}
/// Tries to insert key and value
/// if key already exists returns None
/// 
/// Else returns a reference to the inserted value
/// without using the current lifetime
///
/// ```
/// # use push_while_ref::{HashMapOwner, HashMapChild};
/// let mut map = HashMapOwner::new();
/// let mut map = map.child();
/// let v1 = map.try_insert("10", Box::new(10)).unwrap();
/// let v2 = map.try_insert("20", Box::new(20)).unwrap();
/// assert_eq!(*v1, 10);
/// assert_eq!(*v2, 20);
/// ```
Tries to insert key and value
if key already exists returns None

Else returns a reference to the inserted value
without using the current lifetime


Tries to insert key and value if key already exists returns None Else returns a reference to the inserted value without using the current lifetime
pub fn try_insert(&mut self, key: K, v: T) -> Option<&'a T::Ref> {
		self.0.try_insert(key, v)
			.map(|ptr| {
				// safe because ref does not live longer than HashMapOwner
				unsafe { &*ptr }
			})
	}
pub fn try_insert ( & mut self , key : K , v : T ) -> Option < & ' a T :: Ref > { self . 0 . try_insert ( key , v ) . map ( | ptr | { // safe because ref does not live longer than HashMapOwner unsafe { & * ptr } } ) }
Tries to insert key and value
if key already exists returns None
Tries to insert key and value if key already exists returns None
&mut self
key
K
v
T
&mut self
key
K
v
T
use push_while_ref::{hashmapowner, hashmapchild};
None