pub struct ArcIdU32(/* private fields */);Expand description
An atomically referenced counted version of IdU32.
This exists primarily because it should be possible to look up
Arc<IdU32>’s by u32’s in HashMap’s.
While it is possible to look up Id’s in HashMap’s using
&u32’s, it doesn’t work for Arc<IdU32>’s.
To workaround this limitation this ArcIdU32 newtype
implements Borrow<u32>, which passes it through the
Arc to it’s inner IdU32.
Implementations§
Source§impl ArcIdU32
impl ArcIdU32
Sourcepub fn try_unwrap(this: Self) -> Result<IdU32, Self>
pub fn try_unwrap(this: Self) -> Result<IdU32, Self>
Returns the inner value, if the ArcId has exactly one strong
reference.
§Errors
If there’s more than one strong reference to the
ArcIdU32, the ArcIdU32 will be returned.
Sourcepub fn into_inner(this: Self) -> Option<IdU32>
pub fn into_inner(this: Self) -> Option<IdU32>
Returns the inner value, if the ArcIdU32 has exactly
one strong reference.
Sourcepub fn strong_count(&self) -> usize
pub fn strong_count(&self) -> usize
Return the strong count of internal Arc.
Trait Implementations§
impl Eq for ArcIdU32
impl StructuralPartialEq for ArcIdU32
Auto Trait Implementations§
impl Freeze for ArcIdU32
impl !RefUnwindSafe for ArcIdU32
impl Send for ArcIdU32
impl Sync for ArcIdU32
impl Unpin for ArcIdU32
impl !UnwindSafe for ArcIdU32
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.