pub struct PinRcGenericStorage<T, C: Radium<Item = usize>> { /* private fields */ }Expand description
The common implementation shared by PinRcStorage and PinArcStorage.
Implementations§
Source§impl<T, C: Radium<Item = usize>> PinRcGenericStorage<T, C>
impl<T, C: Radium<Item = usize>> PinRcGenericStorage<T, C>
Source§impl<T, C: Radium<Item = usize>> PinRcGenericStorage<T, C>
impl<T, C: Radium<Item = usize>> PinRcGenericStorage<T, C>
Sourcepub fn ref_count(&self) -> usize
pub fn ref_count(&self) -> usize
Get the number of handles currently referring to self.
Beware of race conditions:
Concurrent operations may change the count between
the time you observe it and the time you act on the observation.
Sourcepub fn get_pinned(&self) -> Pin<&T>
pub fn get_pinned(&self) -> Pin<&T>
Get a pinned reference to the contained value.
Sourcepub fn create_handle(self: Pin<&Self>) -> PinRcGeneric<T, C>
pub fn create_handle(self: Pin<&Self>) -> PinRcGeneric<T, C>
Create a handle referring to self.
Note that this takes Pin<&Self>.
If you have a Pin<&mut Self>, call as_ref:
let arc = storage.as_ref().create_handle();Trait Implementations§
Source§impl<T: Ord, C: Radium<Item = usize>> Ord for PinRcGenericStorage<T, C>
impl<T: Ord, C: Radium<Item = usize>> Ord for PinRcGenericStorage<T, C>
Source§impl<T: PartialOrd, C: Radium<Item = usize>> PartialOrd for PinRcGenericStorage<T, C>
impl<T: PartialOrd, C: Radium<Item = usize>> PartialOrd for PinRcGenericStorage<T, C>
impl<T: Eq, C: Radium<Item = usize>> Eq for PinRcGenericStorage<T, C>
Auto Trait Implementations§
impl<T, C> !Freeze for PinRcGenericStorage<T, C>
impl<T, C> !RefUnwindSafe for PinRcGenericStorage<T, C>
impl<T, C> !Send for PinRcGenericStorage<T, C>
impl<T, C> !Sync for PinRcGenericStorage<T, C>
impl<T, C> !Unpin for PinRcGenericStorage<T, C>
impl<T, C> UnwindSafe for PinRcGenericStorage<T, C>where
C: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more