Struct ffi_support::handle_map::HandleMap [−][src]
pub struct HandleMap<T> { /* fields omitted */ }
Expand description
HandleMap
is a collection type which can hold any type of value, and
offers a stable handle which can be used to retrieve it on insertion. These
handles offer methods for converting to and
from 64 bit integers, meaning they’re very easy to pass
over the FFI (they also implement IntoFfi
for the same purpose).
See the module level docs for more information.
Note: In FFI code, most usage of HandleMap
will be done through the
ConcurrentHandleMap
type, which is a thin wrapper around a
RwLock<HandleMap<Mutex<T>>>
.
Implementations
Allocate a new HandleMap
. Note that the actual capacity may be larger
than the requested value.
Panics if request
is greater than handle_map::MAX_CAPACITY
Insert an item into the map, and return a handle to it.
Delete an item from the HandleMap.
Remove an item from the HandleMap, returning the old value.
Get a reference to the item referenced by the handle, or return a
HandleError
describing the problem.
Get a mut reference to the item referenced by the handle, or return a
HandleError
describing the problem.
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for HandleMap<T> where
T: RefUnwindSafe,
impl<T> UnwindSafe for HandleMap<T> where
T: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more