autopush_common::util

Trait InsertOpt

source
pub trait InsertOpt<K: Eq + Hash, V> {
    // Required method
    fn insert_opt(&mut self, key: impl Into<K>, value: Option<impl Into<V>>);
}

Required Methods§

source

fn insert_opt(&mut self, key: impl Into<K>, value: Option<impl Into<V>>)

Insert an item only if it exists

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<K: Eq + Hash, V> InsertOpt<K, V> for HashMap<K, V>

source§

fn insert_opt(&mut self, key: impl Into<K>, value: Option<impl Into<V>>)

Implementors§