[−][src]Struct dashmap::SharedValue
A simple wrapper around T
This is to prevent UB when using HashMap::get_key_value
, because
HashMap
doesn't expose an api to get the key and value, where
the value is a &mut T
.
See #10 for details
This type is meant to be an implementation detail, but must be exposed due to the Dashmap::shards
Implementations
impl<T> SharedValue<T>
[src]
pub const fn new(value: T) -> Self
[src]
Create a new SharedValue<T>
pub fn get(&self) -> &T
[src]
Get a shared reference to T
pub fn get_mut(&mut self) -> &mut T
[src]
Get an unique reference to T
pub fn into_inner(self) -> T
[src]
Unwraps the value
Trait Implementations
impl<T: Clone> Clone for SharedValue<T>
[src]
pub fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: Send> Send for SharedValue<T>
[src]
impl<T: Sync> Sync for SharedValue<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for SharedValue<T>
[src]
impl<T> Unpin for SharedValue<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for SharedValue<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,