pub fn try_insert(&self, value: V) -> Result<DetachableWeak<K, V>, V> {
        match self.parent.write().entry(self.key.clone()) {
            Entry::Occupied(_) => return Err(value),
            Entry::Vacant(entry) => entry.insert(Arc::new(value)),
        };
        Ok(self.get().unwrap())
    }
/// Attempt to insert into the map at `key`. Returns a detachable weak entry if the value was
/// inserted, and Err(value) if the item already existed.
/// Err(value) if the value was not able to be inserted.
Attempt to insert into the map at `key`. Returns a detachable weak entry if the value was
inserted, and Err(value) if the item already existed.
Err(value) if the value was not able to be inserted.
Attempt to insert into the map at ` key ` . Returns a detachable weak entry if the value was inserted and Err ( value ) if the item already existed . Err ( value ) if the value was not able to be inserted .
pub fn try_insert(&self, value: V) -> Result<DetachableWeak<K, V>, V> {
        match self.parent.write().entry(self.key.clone()) {
            Entry::Occupied(_) => return Err(value),
            Entry::Vacant(entry) => entry.insert(Arc::new(value)),
        };
        Ok(self.get().unwrap())
    }
pub fn try_insert ( & self , value : V ) -> Result < DetachableWeak < K , V > , V > { match self . parent . write ( ) . entry ( self . key . clone ( ) ) { Entry :: Occupied ( _ ) => return Err ( value ) , Entry :: Vacant ( entry ) => entry . insert ( Arc :: new ( value ) ) , } ; Ok ( self . get ( ) . unwrap ( ) ) }
Attempt to insert into the map at `key`.
Attempt to insert into the map at ` key ` .
&self
value
V
&self
value
V