pub struct ArcIdU64(/* private fields */);Expand description
An atomically referenced counted version of IdU64.
This exists primarily because it should be possible to look up
Arc<IdU64>’s by u64’s in HashMap’s.
While it is possible to look up Id’s in HashMap’s using
&u64’s, it doesn’t work for Arc<IdU64>’s.
To workaround this limitation this ArcIdU64 newtype
implements Borrow<u64>, which passes it through the
Arc to it’s inner IdU64.
Implementations§
Source§impl ArcIdU64
impl ArcIdU64
Sourcepub fn try_unwrap(this: Self) -> Result<IdU64, Self>
pub fn try_unwrap(this: Self) -> Result<IdU64, Self>
Returns the inner value, if the ArcId has exactly one strong
reference.
§Errors
If there’s more than one strong reference to the
ArcIdU64, the ArcIdU64 will be returned.
Sourcepub fn into_inner(this: Self) -> Option<IdU64>
pub fn into_inner(this: Self) -> Option<IdU64>
Returns the inner value, if the ArcIdU64 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 ArcIdU64
impl StructuralPartialEq for ArcIdU64
Auto Trait Implementations§
impl Freeze for ArcIdU64
impl !RefUnwindSafe for ArcIdU64
impl Send for ArcIdU64
impl Sync for ArcIdU64
impl Unpin for ArcIdU64
impl !UnwindSafe for ArcIdU64
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.