Trait stam::Handle

source ·
pub trait Handle: Clone + Copy + Debug + PartialEq + Eq + PartialOrd + Ord + Hash + Sealed {
    // Required methods
    fn new(intid: usize) -> Self;
    fn unwrap(&self) -> usize;
}
Expand description

The handle trait is implemented on various handle types. They have in common that refer to the internal id of a crate::store::Storable item in a struct implementing crate::store::StoreFor by index. Types implementing this are lightweight and do not borrow anything, they can be passed and copied freely. This is a sealed trait, not implementable outside this crate.

Required Methods§

source

fn new(intid: usize) -> Self

Create a new handle for an internal ID. You shouldn’t need to use this as handles will always be generated for you by higher-level functions.

source

fn unwrap(&self) -> usize

Returns the internal index for this handle

Implementors§