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