/// Remove the value using the storage associated with the given key from the pool, returning
/// `true` if the value was removed.
///
/// This method does _not_ block the current thread until the value can be
/// cleared. Instead, if another thread is currently accessing that value, this marks it to be
/// cleared by that thread when it is done accessing that value.
///
/// # Examples
///
/// ```rust
/// # use sharded_slab::Pool;
/// let pool: Pool<String> = Pool::new();
/// let key = pool.create(|item| item.push_str("hello world")).unwrap();
///
/// assert_eq!(pool.get(key).unwrap(), String::from("hello world"));
///
/// pool.clear(key);
/// assert!(pool.get(key).is_none());
/// ```
///
/// ```
/// # use sharded_slab::Pool;
/// let pool: Pool<String> = Pool::new();
///
/// let key = pool.create(|item| item.push_str("Hello world!")).unwrap();
///
/// // Clearing a key that doesn't exist in the `Pool` will return `false`
/// assert_eq!(pool.clear(key + 69420), false);
///
/// // Clearing a key that does exist returns `true`
/// assert!(pool.clear(key));
///
/// // Clearing a key that has previously been cleared will return `false`
/// assert_eq!(pool.clear(key), false);
/// ```
/// [`clear`]: #method.clear
Remove the value using the storage associated with the given key from the pool, returning
`true` if the value was removed.

This method does _not_ block the current thread until the value can be
cleared. Instead, if another thread is currently accessing that value, this marks it to be
cleared by that thread when it is done accessing that value.
Remove the value using the storage associated with the given key from the pool returning ` true ` if the value was removed . This method does _not_ block the current thread until the value can be cleared . Instead if another thread is currently accessing that value this marks it to be cleared by that thread when it is done accessing that value .
pub fn clear(&self, key: usize) -> bool {
        let tid = C::unpack_tid(key);
        let shard = self.shards.get(tid.as_usize());
        if tid.is_current() {
            shard
                .map(|shard| shard.mark_clear_local(key))
                .unwrap_or(false)
        } else {
            shard
                .map(|shard| shard.mark_clear_remote(key))
                .unwrap_or(false)
        }
    }
pub fn clear ( & self , key : usize ) -> bool { let tid = C :: unpack_tid ( key ) ; let shard = self . shards . get ( tid . as_usize ( ) ) ; if tid . is_current ( ) { shard . map ( | shard | shard . mark_clear_local ( key ) ) . unwrap_or ( false ) } else { shard . map ( | shard | shard . mark_clear_remote ( key ) ) . unwrap_or ( false ) } }
Remove the value using the storage associated with the given key from the pool, returning
`true` if the value was removed.
Remove the value using the storage associated with the given key from the pool returning ` true ` if the value was removed .
&self
key
usize
examples
None
use sharded_slab::pool;
let pool: Pool = Pool::new();
let key = pool.create(|item| item.push_str("hello world")).unwrap().

assert_eq!(pool.get(key).unwrap(), String::from("hello world")).

pool.clear(key);
assert!(pool.get(key).is_none());
```


let pool : Pool = Pool :: new () ; let key = pool . create ( |item| item . push_str ( " hello world " )) . unwrap () . assert_eq! ( pool . get ( key ) . unwrap () String :: from ( " hello world " )) . pool . clear ( key ) ; assert! ( pool . get ( key ) . is_none () ) ; ` ` `
use sharded_slab::pool;
let pool: Pool = Pool::new().

let key = pool.create(|item| item.push_str("Hello world!")).unwrap().

Clearing a key that doesn't exist in the `Pool` will return `false`
assert_eq!(pool.clear(key + 69420), false).

Clearing a key that does exist returns `true`
assert!(pool.clear(key)).

Clearing a key that has previously been cleared will return `false`
assert_eq!(pool.clear(key), false);
```
[`clear`]: #method.clear
let pool : Pool = Pool :: new () . let key = pool . create ( |item| item . push_str ( " Hello world! " )) . unwrap () . Clearing a key that doesn ' t exist in the ` Pool ` will return ` false ` assert_eq! ( pool . clear ( key + 69420 ) false ) . Clearing a key that does exist returns ` true ` assert! ( pool . clear ( key )) . Clearing a key that has previously been cleared will return ` false ` assert_eq! ( pool . clear ( key ) false ) ; ` ` ` [ ` clear ` ] : #method . clear