[][src]Struct dashmap::SharedValue

#[repr(transparent)]
pub struct SharedValue<T> { /* fields omitted */ }

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

Methods

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]

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>

impl<T> Unpin for SharedValue<T> where
    T: Unpin

impl<T> UnwindSafe for SharedValue<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.