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