Struct OwnedStore
pub(in ::bridge) struct OwnedStore<T: 'static> { pub(in ::bridge::handle) counter: &'static AtomicU32, pub(in ::bridge::handle) data: BTreeMap<NonZero<u32>, T> }
A store that associates values of type T with numeric handles. A value can
be looked up using its handle.
Fields
counter: &'static AtomicU32data: BTreeMap<NonZero<u32>, T>
Implementations
impl<T> OwnedStore<T>
fn new(counter: &'static AtomicU32) -> Self
impl<T> OwnedStore<T>
fn alloc(&mut self, x: T) -> NonZero<u32>fn take(&mut self, h: NonZero<u32>) -> T
Trait Implementations
impl<T> Index<NonZero<u32>> for OwnedStore<T>
type Output = T;fn index(&self, h: NonZero<u32>) -> &T
Auto Trait Implementations
impl<T> Freeze for OwnedStore<T>
where
BTreeMap<NonZero<u32>, T>: Freeze,
impl<T> RefUnwindSafe for OwnedStore<T>
where
BTreeMap<NonZero<u32>, T>: RefUnwindSafe,
impl<T> Send for OwnedStore<T>
where
BTreeMap<NonZero<u32>, T>: Send,
impl<T> Sync for OwnedStore<T>
where
BTreeMap<NonZero<u32>, T>: Sync,
impl<T> Unpin for OwnedStore<T>
where
BTreeMap<NonZero<u32>, T>: Unpin,
impl<T> UnsafeUnpin for OwnedStore<T>
where
BTreeMap<NonZero<u32>, T>: UnsafeUnpin,
impl<T> UnwindSafe for OwnedStore<T>
where
BTreeMap<NonZero<u32>, T>: UnwindSafe,
Blanket Implementations
impl<T> Any for OwnedStore<T>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for OwnedStore<T>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for OwnedStore<T>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for OwnedStore<T>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for OwnedStore<T>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for OwnedStore<T>
impl<T, U> Into<U> for OwnedStore<T>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for OwnedStore<T>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for OwnedStore<T>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>