pub fn create(&self) -> Option<RefMut<'_, T, C>> {
        let (tid, shard) = self.shards.current();
        test_println!("pool: create {:?}", tid);
        let (key, inner) = shard.init_with(|idx, slot| {
            let guard = slot.init()?;
            let gen = guard.generation();
            Some((gen.pack(idx), guard))
        })?;
        Some(RefMut {
            inner,
            key: tid.pack(key),
            shard,
        })
    }
/// Creates a new object in the pool, returning an [`RefMut`] guard that
/// may be used to mutate the new object.
///
/// If this function returns `None`, then the shard for the current thread is full and no items
/// can be added until some are removed, or the maximum number of shards has been reached.
///
/// # Examples
/// ```rust
/// # use sharded_slab::Pool;
/// # use std::thread;
/// let pool: Pool<String> = Pool::new();
///
/// // Create a new pooled item, returning a guard that allows mutable
/// // access to the new item.
/// let mut item = pool.create().unwrap();
/// // Return a key that allows indexing the created item once the guard
/// // has been dropped.
/// let key = item.key();
///
/// // Mutate the item.
/// item.push_str("Hello");
/// // Drop the guard, releasing mutable access to the new item.
/// drop(item);
///
/// /// Other threads may now (immutably) access the item using the returned key.
/// thread::spawn(move || {
///    assert_eq!(pool.get(key).unwrap(), String::from("Hello"));
/// }).join().unwrap();
/// ```
///
/// [`RefMut`]: crate::pool::RefMut
Creates a new object in the pool, returning an [`RefMut`] guard that
may be used to mutate the new object.

If this function returns `None`, then the shard for the current thread is full and no items
can be added until some are removed, or the maximum number of shards has been reached.
Creates a new object in the pool returning an [ ` RefMut ` ] guard that may be used to mutate the new object . If this function returns ` None ` then the shard for the current thread is full and no items can be added until some are removed or the maximum number of shards has been reached .
pub fn create(&self) -> Option<RefMut<'_, T, C>> {
        let (tid, shard) = self.shards.current();
        test_println!("pool: create {:?}", tid);
        let (key, inner) = shard.init_with(|idx, slot| {
            let guard = slot.init()?;
            let gen = guard.generation();
            Some((gen.pack(idx), guard))
        })?;
        Some(RefMut {
            inner,
            key: tid.pack(key),
            shard,
        })
    }
pub fn create ( & self ) -> Option < RefMut < ' _ , T , C > > { let ( tid , shard ) = self . shards . current ( ) ; test_println ! ( " " tid ) ; let ( key , inner ) = shard . init_with ( | idx , slot | { let guard = slot . init ( ) ? ; let gen = guard . generation ( ) ; Some ( ( gen . pack ( idx ) , guard ) ) } ) ? ; Some ( RefMut { inner , key : tid . pack ( key ) , shard , } ) }
Creates a new object in the pool, returning an [`RefMut`] guard that
may be used to mutate the new object.
Creates a new object in the pool returning an [ ` RefMut ` ] guard that may be used to mutate the new object .
&self
&self
examples
None
use sharded_slab::pool;
None
use std::thread;
let pool: Pool = Pool::new().

Create a new pooled item, returning a guard that allows mutable
access to the new item.
let mut item = pool.create().unwrap();
Return a key that allows indexing the created item once the guard
has been dropped.
let key = item.key().

Mutate the item.
item.push_str("Hello");
Drop the guard, releasing mutable access to the new item.
drop(item).

Other threads may now (immutably) access the item using the returned key.

[`RefMut`]: crate::pool::RefMut
let pool : Pool = Pool :: new () . Create a new pooled item returning a guard that allows mutable access to the new item . let mut item = pool . create () . unwrap () ; Return a key that allows indexing the created item once the guard has been dropped . let key = item . key () . Mutate the item . item . push_str ( " Hello " ) ; Drop the guard releasing mutable access to the new item . drop ( item ) . Other threads may now ( immutably ) access the item using the returned key . [ ` RefMut ` ] : crate :: pool :: RefMut