pub trait HashSetHandle<K>{
// Required methods
async fn insert(&self, val: K) -> bool;
async fn is_empty(&self) -> bool;
}Required Methods§
Sourceasync fn insert(&self, val: K) -> bool
async fn insert(&self, val: K) -> bool
Adds a value to the set. Returns whether the value was newly inserted. That is:
- If the set did not previously contain this value, true is returned.
- If the set already contained this value, false is returned, and the set is not modified: original value is not replaced, and the value passed as argument is dropped.
§Examples
let handle = Handle::new(HashSet::new());
let res = handle.insert(10).await.unwrap();
assert_eq!(res, true);
let handle = actify::Handle::new(std::collections::HashSet::new());
handle.insert(10).await.unwrap();
let res = handle.insert(10).await.unwrap();
assert_eq!(res, false);Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.