[][src]Macro pui::make_global_pool

macro_rules! make_global_pool {
    ($(#[$meta:meta])* $v:vis stack $name:ident($item:ty);) => { ... };
    ($(#[$meta:meta])* $v:vis queue $name:ident($item:ty);) => { ... };
    ($(#[$meta:meta])* $v:vis one $name:ident($item:ty);) => { ... };
    ($(#[$meta:meta])* $v:vis thread_local stack $name:ident($item:ty);) => { ... };
    ($(#[$meta:meta])* $v:vis thread_local queue $name:ident($item:ty);) => { ... };
    ($(#[$meta:meta])* $v:vis thread_local one $name:ident($item:ty);) => { ... };
}

Create a new type that implements Pool and PoolMut that can be used with Runtime

For example,

pui::make_global_pool! {
    pub stack MyPool(pui::runtime::Global);
}

let _my_pool = MyPool;

will generate a global pool that yields used ids in FILO order.

in place of stack you can also use,

  • stack - FILO order
  • thread_local stack - FILO order, but stores ids in a thread local (this is best used with thread local ids)
  • queue - FIFO order
  • thread_local queue - FIFO order, but stores ids in a thread local (this is best used with thread local ids)
  • one - stores a single id, best used with a id_alloc backed by ()
  • thread_local one - stores a single id, best used with a thread_local id backed by ()

in place of pui::runtime::Global you can use any type that implements IdAlloc