pub fn insert_raw(&mut self, key_raw: &[u8], value_raw: &[u8]) -> Option<Vec<u8>> {
        let index_lookup = self.raw_key_to_index_lookup(key_raw);
        match env::storage_read(&index_lookup) {
            Some(index_raw) => {
                // The element already exists.
                let index = Self::deserialize_index(&index_raw);
                Some(self.values.replace_raw(index, value_raw))
            }
            None => {
                // The element does not exist yet.
                let next_index = self.len();
                let next_index_raw = Self::serialize_index(next_index);
                env::storage_write(&index_lookup, &next_index_raw);
                self.keys.push_raw(key_raw);
                self.values.push_raw(value_raw);
                None
            }
        }
    }
/// Inserts a serialized key-value pair into the map.
/// If the map did not have this key present, `None` is returned. Otherwise returns
/// a serialized value. Note, the keys that have the same hash value are undistinguished by
/// the implementation.
Inserts a serialized key-value pair into the map.
If the map did not have this key present, `None` is returned. Otherwise returns
a serialized value. Note, the keys that have the same hash value are undistinguished by
the implementation.
Inserts a serialized key - value pair into the map . If the map did not have this key present ` None ` is returned . Otherwise returns a serialized value . Note the keys that have the same hash value are undistinguished by the implementation .
pub fn insert_raw(&mut self, key_raw: &[u8], value_raw: &[u8]) -> Option<Vec<u8>> {
        let index_lookup = self.raw_key_to_index_lookup(key_raw);
        match env::storage_read(&index_lookup) {
            Some(index_raw) => {
                // The element already exists.
                let index = Self::deserialize_index(&index_raw);
                Some(self.values.replace_raw(index, value_raw))
            }
            None => {
                // The element does not exist yet.
                let next_index = self.len();
                let next_index_raw = Self::serialize_index(next_index);
                env::storage_write(&index_lookup, &next_index_raw);
                self.keys.push_raw(key_raw);
                self.values.push_raw(value_raw);
                None
            }
        }
    }
pub fn insert_raw ( & mut self , key_raw : & [ u8 ] , value_raw : & [ u8 ] ) -> Option < Vec < u8 > > { let index_lookup = self . raw_key_to_index_lookup ( key_raw ) ; match env :: storage_read ( & index_lookup ) { Some ( index_raw ) => { // The element already exists. let index = Self :: deserialize_index ( & index_raw ) ; Some ( self . values . replace_raw ( index , value_raw ) ) } None => { // The element does not exist yet. let next_index = self . len ( ) ; let next_index_raw = Self :: serialize_index ( next_index ) ; env :: storage_write ( & index_lookup , & next_index_raw ) ; self . keys . push_raw ( key_raw ) ; self . values . push_raw ( value_raw ) ; None } } }
Inserts a serialized key-value pair into the map.
Inserts a serialized key - value pair into the map .
&mut self
key_raw
&[u8]
value_raw
&[u8]