64 KiB
Crate Documentation
Version: 6.1.0
Format Version: 57
Module dashmap
Modules
Module iter
pub mod iter { /* ... */ }
Types
Struct OwningIter
Iterator over a DashMap yielding key value pairs.
Examples
use dashmap::DashMap;
let map = DashMap::new();
map.insert("hello", "world");
map.insert("alex", "steve");
let pairs: Vec<(&'static str, &'static str)> = map.into_iter().collect();
assert_eq!(pairs.len(), 2);
pub struct OwningIter<K, V, S = std::collections::hash_map::RandomState> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoIterator
-
fn into_iter(self: Self) -> I { /* ... */ }
-
-
Iterator
-
fn next(self: &mut Self) -> Option<<Self as >::Item> { /* ... */ }
-
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct Iter
Iterator over a DashMap yielding immutable references.
Examples
use dashmap::DashMap;
let map = DashMap::new();
map.insert("hello", "world");
assert_eq!(map.iter().count(), 1);
pub struct Iter<''a, K, V, S = std::collections::hash_map::RandomState, M = crate::DashMap<K, V, S>> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Clone
-
fn clone(self: &Self) -> Self { /* ... */ }
-
-
CloneToUninit
-
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoIterator
-
fn into_iter(self: Self) -> I { /* ... */ }
-
-
Iterator
-
fn next(self: &mut Self) -> Option<<Self as >::Item> { /* ... */ }
-
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
ToOwned
-
fn to_owned(self: &Self) -> T { /* ... */ } -
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
-
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct IterMut
Iterator over a DashMap yielding mutable references.
Examples
use dashmap::DashMap;
let map = DashMap::new();
map.insert("Johnny", 21);
map.iter_mut().for_each(|mut r| *r += 1);
assert_eq!(*map.get("Johnny").unwrap(), 22);
pub struct IterMut<''a, K, V, S = std::collections::hash_map::RandomState, M = crate::DashMap<K, V, S>> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoIterator
-
fn into_iter(self: Self) -> I { /* ... */ }
-
-
Iterator
-
fn next(self: &mut Self) -> Option<<Self as >::Item> { /* ... */ }
-
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Module iter_set
pub mod iter_set { /* ... */ }
Types
Struct OwningIter
pub struct OwningIter<K, S> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoIterator
-
fn into_iter(self: Self) -> I { /* ... */ }
-
-
Iterator
-
fn next(self: &mut Self) -> Option<<Self as >::Item> { /* ... */ }
-
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct Iter
pub struct Iter<''a, K, S, M> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoIterator
-
fn into_iter(self: Self) -> I { /* ... */ }
-
-
Iterator
-
fn next(self: &mut Self) -> Option<<Self as >::Item> { /* ... */ }
-
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Module mapref
pub mod mapref { /* ... */ }
Modules
Module entry
pub mod entry { /* ... */ }
Types
Enum Entry
pub enum Entry<''a, K, V> {
Occupied(OccupiedEntry<''a, K, V>),
Vacant(VacantEntry<''a, K, V>),
}
Variants
Occupied
Fields:
| Index | Type | Documentation |
|---|---|---|
| 0 | OccupiedEntry<''a, K, V> |
Vacant
Fields:
| Index | Type | Documentation |
|---|---|---|
| 0 | VacantEntry<''a, K, V> |
Implementations
Methods
-
pub fn and_modify</* synthetic */ impl FnOnce(&mut V): FnOnce(&mut V)>(self: Self, f: impl FnOnce(&mut V)) -> Self { /* ... */ }Apply a function to the stored value if it exists.
-
pub fn key(self: &Self) -> &K { /* ... */ }Get the key of the entry.
-
pub fn into_key(self: Self) -> K { /* ... */ }Into the key of the entry.
-
pub fn or_default(self: Self) -> RefMut<''a, K, V>
where V: Default { /* ... */ }
Return a mutable reference to the element if it exists,
- ```rust
pub fn or_insert(self: Self, value: V) -> RefMut<''a, K, V> { /* ... */ }
Return a mutable reference to the element if it exists,
-
pub fn or_insert_with</* synthetic */ impl FnOnce() -> V: FnOnce() -> V>(self: Self, value: impl FnOnce() -> V) -> RefMut<''a, K, V> { /* ... */ }Return a mutable reference to the element if it exists,
-
pub fn or_try_insert_with<E, /* synthetic */ impl FnOnce() -> Result<V, E>: FnOnce() -> Result<V, E>>(self: Self, value: impl FnOnce() -> Result<V, E>) -> Result<RefMut<''a, K, V>, E> { /* ... */ } -
pub fn insert(self: Self, value: V) -> RefMut<''a, K, V> { /* ... */ }Sets the value of the entry, and returns a reference to the inserted value.
-
pub fn insert_entry(self: Self, value: V) -> OccupiedEntry<''a, K, V>
where K: Clone { /* ... */ }
Sets the value of the entry, and returns an OccupiedEntry.
###### Trait Implementations
- **Any**
- ```rust
fn type_id(self: &Self) -> TypeId { /* ... */ }
```
- **Borrow**
- ```rust
fn borrow(self: &Self) -> &T { /* ... */ }
```
- **BorrowMut**
- ```rust
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
```
- **Freeze**
- **From**
- ```rust
fn from(t: T) -> T { /* ... */ }
```
Returns the argument unchanged.
- **Into**
- ```rust
fn into(self: Self) -> U { /* ... */ }
```
Calls `U::from(self)`.
- **IntoEither**
- **Pointable**
- ```rust
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ }
```
- ```rust
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ }
```
- ```rust
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ }
```
- ```rust
unsafe fn drop(ptr: usize) { /* ... */ }
```
- **RefUnwindSafe**
- **Send**
- **Sync**
- **TryFrom**
- ```rust
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
```
- **TryInto**
- ```rust
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
```
- **Unpin**
- **UnwindSafe**
#### Struct `VacantEntry`
```rust
pub struct VacantEntry<''a, K, V> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn insert(self: Self, value: V) -> RefMut<''a, K, V> { /* ... */ } -
pub fn insert_entry(self: Self, value: V) -> OccupiedEntry<''a, K, V>
where K: Clone { /* ... */ }
Sets the value of the entry with the VacantEntry’s key, and returns an OccupiedEntry.
- ```rust
pub fn into_key(self: Self) -> K { /* ... */ }
-
pub fn key(self: &Self) -> &K { /* ... */ }
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct OccupiedEntry
pub struct OccupiedEntry<''a, K, V> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn get(self: &Self) -> &V { /* ... */ } -
pub fn get_mut(self: &mut Self) -> &mut V { /* ... */ } -
pub fn insert(self: &mut Self, value: V) -> V { /* ... */ } -
pub fn into_ref(self: Self) -> RefMut<''a, K, V> { /* ... */ } -
pub fn into_key(self: Self) -> K { /* ... */ } -
pub fn key(self: &Self) -> &K { /* ... */ } -
pub fn remove(self: Self) -> V { /* ... */ } -
pub fn remove_entry(self: Self) -> (K, V) { /* ... */ } -
pub fn replace_entry(self: Self, value: V) -> (K, V) { /* ... */ }
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Module multiple
pub mod multiple { /* ... */ }
Types
Struct RefMulti
pub struct RefMulti<''a, K, V> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn key(self: &Self) -> &K { /* ... */ } -
pub fn value(self: &Self) -> &V { /* ... */ } -
pub fn pair(self: &Self) -> (&K, &V) { /* ... */ }
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Deref
-
fn deref(self: &Self) -> &V { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
Receiver
-
RefUnwindSafe
-
Send
-
Serialize
-
fn serialize<Ser>(self: &Self, serializer: Ser) -> Result<<Ser as >::Ok, <Ser as >::Error>
-
where Ser: serde::Serializer { /* ... */ } ```
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct RefMutMulti
pub struct RefMutMulti<''a, K, V> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn key(self: &Self) -> &K { /* ... */ } -
pub fn value(self: &Self) -> &V { /* ... */ } -
pub fn value_mut(self: &mut Self) -> &mut V { /* ... */ } -
pub fn pair(self: &Self) -> (&K, &V) { /* ... */ } -
pub fn pair_mut(self: &mut Self) -> (&K, &mut V) { /* ... */ }
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Deref
-
fn deref(self: &Self) -> &V { /* ... */ }
-
-
DerefMut
-
fn deref_mut(self: &mut Self) -> &mut V { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
Receiver
-
RefUnwindSafe
-
Send
-
Serialize
-
fn serialize<Ser>(self: &Self, serializer: Ser) -> Result<<Ser as >::Ok, <Ser as >::Error>
-
where Ser: serde::Serializer { /* ... */ } ```
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Module one
pub mod one { /* ... */ }
Types
Struct Ref
pub struct Ref<''a, K, V> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn key(self: &Self) -> &K { /* ... */ } -
pub fn value(self: &Self) -> &V { /* ... */ } -
pub fn pair(self: &Self) -> (&K, &V) { /* ... */ } -
pub fn map<F, T>(self: Self, f: F) -> MappedRef<''a, K, V, T>
where F: FnOnce(&V) -> &T { /* ... */ }
- ```rust
pub fn try_map<F, T>(self: Self, f: F) -> Result<MappedRef<''a, K, V, T>, Self>
where
F: FnOnce(&V) -> Option<&T> { /* ... */ }
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Debug
-
fn fmt(self: &Self, f: &mut Formatter<''_>) -> std::fmt::Result { /* ... */ }
-
-
Deref
-
fn deref(self: &Self) -> &V { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
Receiver
-
RefUnwindSafe
-
Send
-
Serialize
-
fn serialize<Ser>(self: &Self, serializer: Ser) -> Result<<Ser as >::Ok, <Ser as >::Error>
-
where Ser: serde::Serializer { /* ... */ } ```
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct RefMut
pub struct RefMut<''a, K, V> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn key(self: &Self) -> &K { /* ... */ } -
pub fn value(self: &Self) -> &V { /* ... */ } -
pub fn value_mut(self: &mut Self) -> &mut V { /* ... */ } -
pub fn pair(self: &Self) -> (&K, &V) { /* ... */ } -
pub fn pair_mut(self: &mut Self) -> (&K, &mut V) { /* ... */ } -
pub fn downgrade(self: Self) -> Ref<''a, K, V> { /* ... */ } -
pub fn map<F, T>(self: Self, f: F) -> MappedRefMut<''a, K, V, T>
where F: FnOnce(&mut V) -> &mut T { /* ... */ }
- ```rust
pub fn try_map<F, T>(self: Self, f: F) -> Result<MappedRefMut<''a, K, V, T>, Self>
where
F: FnOnce(&mut V) -> Option<&mut T> { /* ... */ }
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Debug
-
fn fmt(self: &Self, f: &mut Formatter<''_>) -> std::fmt::Result { /* ... */ }
-
-
Deref
-
fn deref(self: &Self) -> &V { /* ... */ }
-
-
DerefMut
-
fn deref_mut(self: &mut Self) -> &mut V { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
Receiver
-
RefUnwindSafe
-
Send
-
Serialize
-
fn serialize<Ser>(self: &Self, serializer: Ser) -> Result<<Ser as >::Ok, <Ser as >::Error>
-
where Ser: serde::Serializer { /* ... */ } ```
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct MappedRef
pub struct MappedRef<''a, K, V, T> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn key(self: &Self) -> &K { /* ... */ } -
pub fn value(self: &Self) -> &T { /* ... */ } -
pub fn pair(self: &Self) -> (&K, &T) { /* ... */ } -
pub fn map<F, T2>(self: Self, f: F) -> MappedRef<''a, K, V, T2>
where F: FnOnce(&T) -> &T2 { /* ... */ }
- ```rust
pub fn try_map<F, T2>(self: Self, f: F) -> Result<MappedRef<''a, K, V, T2>, Self>
where
F: FnOnce(&T) -> Option<&T2> { /* ... */ }
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
AsRef
-
fn as_ref(self: &Self) -> &TDeref { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Debug
-
fn fmt(self: &Self, f: &mut Formatter<''_>) -> std::fmt::Result { /* ... */ }
-
-
Deref
-
fn deref(self: &Self) -> &T { /* ... */ }
-
-
Display
-
fn fmt(self: &Self, f: &mut std::fmt::Formatter<''_>) -> std::fmt::Result { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
Receiver
-
RefUnwindSafe
-
Send
-
Serialize
-
fn serialize<Ser>(self: &Self, serializer: Ser) -> Result<<Ser as >::Ok, <Ser as >::Error>
-
where Ser: serde::Serializer { /* ... */ } ```
-
Sync
-
ToString
-
fn to_string(self: &Self) -> String { /* ... */ }
-
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct MappedRefMut
pub struct MappedRefMut<''a, K, V, T> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn key(self: &Self) -> &K { /* ... */ } -
pub fn value(self: &Self) -> &T { /* ... */ } -
pub fn value_mut(self: &mut Self) -> &mut T { /* ... */ } -
pub fn pair(self: &Self) -> (&K, &T) { /* ... */ } -
pub fn pair_mut(self: &mut Self) -> (&K, &mut T) { /* ... */ } -
pub fn map<F, T2>(self: Self, f: F) -> MappedRefMut<''a, K, V, T2>
where F: FnOnce(&mut T) -> &mut T2 { /* ... */ }
- ```rust
pub fn try_map<F, T2>(self: Self, f: F) -> Result<MappedRefMut<''a, K, V, T2>, Self>
where
F: FnOnce(&mut T) -> Option<&mut T2> { /* ... */ }
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Debug
-
fn fmt(self: &Self, f: &mut Formatter<''_>) -> std::fmt::Result { /* ... */ }
-
-
Deref
-
fn deref(self: &Self) -> &T { /* ... */ }
-
-
DerefMut
-
fn deref_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
Receiver
-
RefUnwindSafe
-
Send
-
Serialize
-
fn serialize<Ser>(self: &Self, serializer: Ser) -> Result<<Ser as >::Ok, <Ser as >::Error>
-
where Ser: serde::Serializer { /* ... */ } ```
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Module setref
pub mod setref { /* ... */ }
Modules
Module multiple
pub mod multiple { /* ... */ }
Types
Struct RefMulti
pub struct RefMulti<''a, K> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn key(self: &Self) -> &K { /* ... */ }
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Deref
-
fn deref(self: &Self) -> &K { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
Receiver
-
RefUnwindSafe
-
Send
-
Serialize
-
fn serialize<Ser>(self: &Self, serializer: Ser) -> Result<<Ser as >::Ok, <Ser as >::Error>
-
where Ser: serde::Serializer { /* ... */ } ```
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Module one
pub mod one { /* ... */ }
Types
Struct Ref
pub struct Ref<''a, K> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn key(self: &Self) -> &K { /* ... */ }
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Deref
-
fn deref(self: &Self) -> &K { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
Receiver
-
RefUnwindSafe
-
Send
-
Serialize
-
fn serialize<Ser>(self: &Self, serializer: Ser) -> Result<<Ser as >::Ok, <Ser as >::Error>
-
where Ser: serde::Serializer { /* ... */ } ```
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Module try_result
pub mod try_result { /* ... */ }
Types
Enum TryResult
Represents the result of a non-blocking read from a DashMap.
pub enum TryResult<R> {
Present(R),
Absent,
Locked,
}
Variants
Present
The value was present in the map, and the lock for the shard was successfully obtained.
Fields:
| Index | Type | Documentation |
|---|---|---|
| 0 | R |
Absent
The shard wasn't locked, and the value wasn't present in the map.
Locked
The shard was locked.
Implementations
Methods
-
pub fn is_present(self: &Self) -> bool { /* ... */ }Returns
trueif the value was present in the map, and the lock for the shard was successfully obtained. -
pub fn is_absent(self: &Self) -> bool { /* ... */ }Returns
trueif the shard wasn't locked, and the value wasn't present in the map. -
pub fn is_locked(self: &Self) -> bool { /* ... */ }Returns
trueif the shard was locked. -
pub fn unwrap(self: Self) -> R { /* ... */ }If
selfis Present, returns the reference to the value in the map. -
pub fn try_unwrap(self: Self) -> Option<R> { /* ... */ }If
selfis Present, returns the reference to the value in the map.
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Debug
-
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Module rayon
Attributes:
Other("#[<cfg_trace>(feature = \"rayon\")]")
pub mod rayon { /* ... */ }
Modules
Module map
pub mod map { /* ... */ }
Types
Struct OwningIter
pub struct OwningIter<K, V> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoParallelIterator
-
fn into_par_iter(self: Self) -> T { /* ... */ }
-
-
ParallelIterator
-
fn drive_unindexed<C>(self: Self, consumer: C) -> <C as >::Result
-
where C: UnindexedConsumer<::Item> { /* ... */ } ```
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct Iter
pub struct Iter<''a, K, V> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoParallelIterator
-
fn into_par_iter(self: Self) -> T { /* ... */ }
-
-
ParallelIterator
-
fn drive_unindexed<C>(self: Self, consumer: C) -> <C as >::Result
-
where C: UnindexedConsumer<::Item> { /* ... */ } ```
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct IterMut
pub struct IterMut<''a, K, V> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoParallelIterator
-
fn into_par_iter(self: Self) -> T { /* ... */ }
-
-
ParallelIterator
-
fn drive_unindexed<C>(self: Self, consumer: C) -> <C as >::Result
-
where C: UnindexedConsumer<::Item> { /* ... */ } ```
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Module read_only
pub mod read_only { /* ... */ }
Module set
pub mod set { /* ... */ }
Types
Struct OwningIter
pub struct OwningIter<K> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoParallelIterator
-
fn into_par_iter(self: Self) -> T { /* ... */ }
-
-
ParallelIterator
-
fn drive_unindexed<C>(self: Self, consumer: C) -> <C as >::Result
-
where C: UnindexedConsumer<::Item> { /* ... */ } ```
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct Iter
pub struct Iter<''a, K> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoParallelIterator
-
fn into_par_iter(self: Self) -> T { /* ... */ }
-
-
ParallelIterator
-
fn drive_unindexed<C>(self: Self, consumer: C) -> <C as >::Result
-
where C: UnindexedConsumer<::Item> { /* ... */ } ```
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Sync
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Types
Struct TryReserveError
Attributes:
NonExhaustive
pub struct TryReserveError {
}
Fields
| Name | Type | Documentation |
|---|
Implementations
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Clone
-
fn clone(self: &Self) -> TryReserveError { /* ... */ }
-
-
CloneToUninit
-
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
-
-
Debug
-
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<''_>) -> $crate::fmt::Result { /* ... */ }
-
-
Eq
-
Equivalent
-
fn equivalent(self: &Self, key: &K) -> bool { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
PartialEq
-
fn eq(self: &Self, other: &TryReserveError) -> bool { /* ... */ }
-
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
StructuralPartialEq
-
Sync
-
ToOwned
-
fn to_owned(self: &Self) -> T { /* ... */ } -
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
-
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Struct DashMap
DashMap is an implementation of a concurrent associative array/hashmap in Rust.
DashMap tries to implement an easy to use API similar to std::collections::HashMap
with some slight changes to handle concurrency.
DashMap tries to be very simple to use and to be a direct replacement for RwLock<HashMap<K, V>>.
To accomplish this, all methods take &self instead of modifying methods taking &mut self.
This allows you to put a DashMap in an Arc<T> and share it between threads while being able to modify it.
Documentation mentioning locking behaviour acts in the reference frame of the calling thread. This means that it is safe to ignore it across multiple threads.
pub struct DashMap<K, V, S = std::collections::hash_map::RandomState> {
// Some fields omitted
}
Fields
| Name | Type | Documentation |
|---|---|---|
| private fields | ... | Some fields have been omitted |
Implementations
Methods
-
pub fn par_iter_mut(self: &Self) -> IterMut<''_, K, V> { /* ... */ } -
pub fn new() -> Self { /* ... */ }Creates a new DashMap with a capacity of 0.
-
pub fn with_capacity(capacity: usize) -> Self { /* ... */ }Creates a new DashMap with a specified starting capacity.
-
pub fn with_shard_amount(shard_amount: usize) -> Self { /* ... */ }Creates a new DashMap with a specified shard amount
-
pub fn with_capacity_and_shard_amount(capacity: usize, shard_amount: usize) -> Self { /* ... */ }Creates a new DashMap with a specified capacity and shard amount.
-
pub fn into_read_only(self: Self) -> ReadOnlyView<K, V, S> { /* ... */ }Wraps this
DashMapinto a read-only view. This view allows to obtain raw references to the stored values. -
pub fn with_hasher(hasher: S) -> Self { /* ... */ }Creates a new DashMap with a capacity of 0 and the provided hasher.
-
pub fn with_capacity_and_hasher(capacity: usize, hasher: S) -> Self { /* ... */ }Creates a new DashMap with a specified starting capacity and hasher.
-
pub fn with_hasher_and_shard_amount(hasher: S, shard_amount: usize) -> Self { /* ... */ }Creates a new DashMap with a specified hasher and shard amount
-
pub fn with_capacity_and_hasher_and_shard_amount(capacity: usize, hasher: S, shard_amount: usize) -> Self { /* ... */ }Creates a new DashMap with a specified starting capacity, hasher and shard_amount.
-
pub fn hash_usize<T: Hash>(self: &Self, item: &T) -> usize { /* ... */ }Hash a given item to produce a usize.
-
pub fn shards(self: &Self) -> &[CachePadded<RwLock<hashbrown::raw::RawTable<(K, SharedValue<V>)>>>] { /* ... */ }Allows you to peek at the inner shards that store your data.
-
pub fn shards_mut(self: &mut Self) -> &mut [CachePadded<RwLock<hashbrown::raw::RawTable<(K, SharedValue<V>)>>>] { /* ... */ }Provides mutable access to the inner shards that store your data.
-
pub fn into_shards(self: Self) -> Box<[CachePadded<RwLock<hashbrown::raw::RawTable<(K, SharedValue<V>)>>>]> { /* ... */ }Consumes this
DashMapand returns the inner shards. -
pub fn determine_map<Q>(self: &Self, key: &Q) -> usize
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
Finds which shard a certain key is stored in.
- ```rust
pub fn determine_shard(self: &Self, hash: usize) -> usize { /* ... */ }
Finds which shard a certain hash is stored in.
-
pub fn hasher(self: &Self) -> &S { /* ... */ }Returns a reference to the map's [
BuildHasher]. -
pub fn insert(self: &Self, key: K, value: V) -> Option<V> { /* ... */ }Inserts a key and a value into the map. Returns the old value associated with the key if there was one.
-
pub fn remove<Q>(self: &Self, key: &Q) -> Option<(K, V)>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
Removes an entry from the map, returning the key and value if they existed in the map.
- ```rust
pub fn remove_if<Q, /* synthetic */ impl FnOnce(&K, &V) -> bool: FnOnce(&K, &V) -> bool>(self: &Self, key: &Q, f: impl FnOnce(&K, &V) -> bool) -> Option<(K, V)>
where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized { /* ... */ }
Removes an entry from the map, returning the key and value
-
pub fn remove_if_mut<Q, /* synthetic */ impl FnOnce(&K, &mut V) -> bool: FnOnce(&K, &mut V) -> bool>(self: &Self, key: &Q, f: impl FnOnce(&K, &mut V) -> bool) -> Option<(K, V)>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
- ```rust
pub fn iter(self: &''a Self) -> Iter<''a, K, V, S, DashMap<K, V, S>> { /* ... */ }
Creates an iterator over a DashMap yielding immutable references.
-
pub fn iter_mut(self: &''a Self) -> IterMut<''a, K, V, S, DashMap<K, V, S>> { /* ... */ }Iterator over a DashMap yielding mutable references.
-
pub fn get<Q>(self: &''a Self, key: &Q) -> Option<Ref<''a, K, V>>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
Get an immutable reference to an entry in the map
- ```rust
pub fn get_mut<Q>(self: &''a Self, key: &Q) -> Option<RefMut<''a, K, V>>
where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized { /* ... */ }
Get a mutable reference to an entry in the map
-
pub fn try_get<Q>(self: &''a Self, key: &Q) -> TryResult<Ref<''a, K, V>>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
Get an immutable reference to an entry in the map, if the shard is not locked.
- ```rust
pub fn try_get_mut<Q>(self: &''a Self, key: &Q) -> TryResult<RefMut<''a, K, V>>
where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized { /* ... */ }
Get a mutable reference to an entry in the map, if the shard is not locked.
-
pub fn shrink_to_fit(self: &Self) { /* ... */ }Remove excess capacity to reduce memory usage.
-
pub fn retain</* synthetic */ impl FnMut(&K, &mut V) -> bool: FnMut(&K, &mut V) -> bool>(self: &Self, f: impl FnMut(&K, &mut V) -> bool) { /* ... */ }Retain elements that whose predicates return true
-
pub fn len(self: &Self) -> usize { /* ... */ }Fetches the total number of key-value pairs stored in the map.
-
pub fn is_empty(self: &Self) -> bool { /* ... */ }Checks if the map is empty or not.
-
pub fn clear(self: &Self) { /* ... */ }Removes all key-value pairs in the map.
-
pub fn capacity(self: &Self) -> usize { /* ... */ }Returns how many key-value pairs the map can store without reallocating.
-
pub fn alter<Q, /* synthetic */ impl FnOnce(&K, V) -> V: FnOnce(&K, V) -> V>(self: &Self, key: &Q, f: impl FnOnce(&K, V) -> V)
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
Modify a specific value according to a function.
- ```rust
pub fn alter_all</* synthetic */ impl FnMut(&K, V) -> V: FnMut(&K, V) -> V>(self: &Self, f: impl FnMut(&K, V) -> V) { /* ... */ }
Modify every value in the map according to a function.
-
pub fn view<Q, R, /* synthetic */ impl FnOnce(&K, &V) -> R: FnOnce(&K, &V) -> R>(self: &Self, key: &Q, f: impl FnOnce(&K, &V) -> R) -> Option<R>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
Scoped access into an item of the map according to a function.
- ```rust
pub fn contains_key<Q>(self: &Self, key: &Q) -> bool
where
K: Borrow<Q>,
Q: Hash + Eq + ?Sized { /* ... */ }
Checks if the map contains a specific key.
-
pub fn entry(self: &''a Self, key: K) -> Entry<''a, K, V> { /* ... */ }Advanced entry API that tries to mimic
std::collections::HashMap. -
pub fn try_entry(self: &''a Self, key: K) -> Option<Entry<''a, K, V>> { /* ... */ }Advanced entry API that tries to mimic
std::collections::HashMap. -
pub fn try_reserve(self: &mut Self, additional: usize) -> Result<(), TryReserveError> { /* ... */ }Advanced entry API that tries to mimic
std::collections::HashMap::try_reserve.
Trait Implementations
-
Any
-
fn type_id(self: &Self) -> TypeId { /* ... */ }
-
-
BitAnd
-
fn bitand(self: Self, key: &Q) -> <Self as >::Output { /* ... */ }
-
-
BitOr
-
fn bitor(self: Self, key: &Q) -> <Self as >::Output { /* ... */ }
-
-
Borrow
-
fn borrow(self: &Self) -> &T { /* ... */ }
-
-
BorrowMut
-
fn borrow_mut(self: &mut Self) -> &mut T { /* ... */ }
-
-
Clone
-
fn clone(self: &Self) -> Self { /* ... */ }
-
-
CloneToUninit
-
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8) { /* ... */ }
-
-
Debug
-
fn fmt(self: &Self, f: &mut fmt::Formatter<''_>) -> fmt::Result { /* ... */ }
-
-
Default
-
fn default() -> Self { /* ... */ }
-
-
Deserialize
-
fn deserialize<D>(deserializer: D) -> Result<Self, <D as >::Error>
-
where D: Deserializer<''de> { /* ... */ } ```
-
DeserializeOwned
-
Extend
-
fn extend<I: IntoIterator<Item = (K, V)>>(self: &mut Self, intoiter: I) { /* ... */ }
-
-
Freeze
-
From
-
Returns the argument unchanged.
fn from(t: T) -> T { /* ... */ }
-
-
FromIterator
-
fn from_iter<I: IntoIterator<Item = (K, V)>>(intoiter: I) -> Self { /* ... */ }
-
-
FromParallelIterator
-
fn from_par_iter<I>(par_iter: I) -> Self
-
where I: IntoParallelIterator<Item = (K, V)> { /* ... */ } ```
-
Into
-
Calls
fn into(self: Self) -> U { /* ... */ }U::from(self).
-
-
IntoEither
-
IntoIterator
-
fn into_iter(self: Self) -> <Self as >::IntoIter { /* ... */ } -
fn into_iter(self: Self) -> <Self as >::IntoIter { /* ... */ }
-
-
IntoParallelIterator
-
fn into_par_iter(self: Self) -> <Self as >::Iter { /* ... */ } -
fn into_par_iter(self: Self) -> <Self as >::Iter { /* ... */ } -
fn into_par_iter(self: Self) -> <Self as >::Iter { /* ... */ }
-
-
IntoParallelRefIterator
-
fn par_iter(self: &''data Self) -> <I as IntoParallelRefIterator<''data>>::Iter { /* ... */ }
-
-
IntoParallelRefMutIterator
-
fn par_iter_mut(self: &''data mut Self) -> <I as IntoParallelRefMutIterator<''data>>::Iter { /* ... */ }
-
-
Map
-
fn _shard_count(self: &Self) -> usize { /* ... */ } -
unsafe fn _get_read_shard(self: &''a Self, i: usize) -> &''a hashbrown::raw::RawTable<(K, SharedValue<V>)> { /* ... */ } -
unsafe fn _yield_read_shard(self: &''a Self, i: usize) -> RwLockReadGuard<''a, hashbrown::raw::RawTable<(K, SharedValue<V>)>> { /* ... */ } -
unsafe fn _yield_write_shard(self: &''a Self, i: usize) -> RwLockWriteGuard<''a, hashbrown::raw::RawTable<(K, SharedValue<V>)>> { /* ... */ } -
unsafe fn _try_yield_read_shard(self: &''a Self, i: usize) -> Option<RwLockReadGuard<''a, hashbrown::raw::RawTable<(K, SharedValue<V>)>>> { /* ... */ } -
unsafe fn _try_yield_write_shard(self: &''a Self, i: usize) -> Option<RwLockWriteGuard<''a, hashbrown::raw::RawTable<(K, SharedValue<V>)>>> { /* ... */ } -
fn _insert(self: &Self, key: K, value: V) -> Option<V> { /* ... */ } -
fn _remove<Q>(self: &Self, key: &Q) -> Option<(K, V)>
-
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
```
-
fn _remove_if<Q, /* synthetic */ impl FnOnce(&K, &V) -> bool: FnOnce(&K, &V) -> bool>(self: &Self, key: &Q, f: impl FnOnce(&K, &V) -> bool) -> Option<(K, V)>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
```
-
fn _remove_if_mut<Q, /* synthetic */ impl FnOnce(&K, &mut V) -> bool: FnOnce(&K, &mut V) -> bool>(self: &Self, key: &Q, f: impl FnOnce(&K, &mut V) -> bool) -> Option<(K, V)>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
```
-
fn _iter(self: &''a Self) -> Iter<''a, K, V, S, DashMap<K, V, S>> { /* ... */ } -
fn _iter_mut(self: &''a Self) -> IterMut<''a, K, V, S, DashMap<K, V, S>> { /* ... */ } -
fn _get<Q>(self: &''a Self, key: &Q) -> Option<Ref<''a, K, V>>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
```
-
fn _get_mut<Q>(self: &''a Self, key: &Q) -> Option<RefMut<''a, K, V>>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
```
-
fn _try_get<Q>(self: &''a Self, key: &Q) -> TryResult<Ref<''a, K, V>>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
```
-
fn _try_get_mut<Q>(self: &''a Self, key: &Q) -> TryResult<RefMut<''a, K, V>>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
```
-
fn _shrink_to_fit(self: &Self) { /* ... */ } -
fn _retain</* synthetic */ impl FnMut(&K, &mut V) -> bool: FnMut(&K, &mut V) -> bool>(self: &Self, f: impl FnMut(&K, &mut V) -> bool) { /* ... */ } -
fn _len(self: &Self) -> usize { /* ... */ } -
fn _capacity(self: &Self) -> usize { /* ... */ } -
fn _alter<Q, /* synthetic */ impl FnOnce(&K, V) -> V: FnOnce(&K, V) -> V>(self: &Self, key: &Q, f: impl FnOnce(&K, V) -> V)
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
```
-
fn _alter_all</* synthetic */ impl FnMut(&K, V) -> V: FnMut(&K, V) -> V>(self: &Self, f: impl FnMut(&K, V) -> V) { /* ... */ } -
fn _view<Q, R, /* synthetic */ impl FnOnce(&K, &V) -> R: FnOnce(&K, &V) -> R>(self: &Self, key: &Q, f: impl FnOnce(&K, &V) -> R) -> Option<R>
where
K: Borrow,
Q: Hash + Eq + ?Sized { /* ... */ }
```
-
fn _entry(self: &''a Self, key: K) -> Entry<''a, K, V> { /* ... */ } -
fn _try_entry(self: &''a Self, key: K) -> Option<Entry<''a, K, V>> { /* ... */ } -
fn _hasher(self: &Self) -> S { /* ... */ } -
ParallelExtend
-
fn par_extend<I>(self: &mut Self, par_iter: I)
-
where I: IntoParallelIterator<Item = (K, V)> { /* ... */ } ```
-
fn par_extend<I>(self: &mut Self, par_iter: I)
where I: IntoParallelIterator<Item = (K, V)> { /* ... */ } ```
-
Pointable
-
unsafe fn init(init: <T as Pointable>::Init) -> usize { /* ... */ } -
unsafe fn deref<''a>(ptr: usize) -> &''a T { /* ... */ } -
unsafe fn deref_mut<''a>(ptr: usize) -> &''a mut T { /* ... */ } -
unsafe fn drop(ptr: usize) { /* ... */ }
-
-
RefUnwindSafe
-
Send
-
Serialize
-
fn serialize<S>(self: &Self, serializer: S) -> Result<<S as >::Ok, <S as >::Error>
-
where S: Serializer { /* ... */ } ```
-
Shl
-
fn shl(self: Self, pair: (K, V)) -> <Self as >::Output { /* ... */ }
-
-
Shr
-
fn shr(self: Self, key: &Q) -> <Self as >::Output { /* ... */ }
-
-
Sub
-
fn sub(self: Self, key: &Q) -> <Self as >::Output { /* ... */ }
-
-
Sync
-
ToOwned
-
fn to_owned(self: &Self) -> T { /* ... */ } -
fn clone_into(self: &Self, target: &mut T) { /* ... */ }
-
-
TryFrom
-
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> { /* ... */ }
-
-
TryInto
-
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error> { /* ... */ }
-
-
Unpin
-
UnwindSafe
Re-exports
Re-export RawRwLock
Attributes:
Other("#[<cfg_trace>(feature = \"raw-api\")]")
pub use crate::lock::RawRwLock;
Re-export RwLock
Attributes:
Other("#[<cfg_trace>(feature = \"raw-api\")]")
pub use crate::lock::RwLock;
Re-export RwLockReadGuard
Attributes:
Other("#[<cfg_trace>(feature = \"raw-api\")]")
pub use crate::lock::RwLockReadGuard;
Re-export RwLockWriteGuard
Attributes:
Other("#[<cfg_trace>(feature = \"raw-api\")]")
pub use crate::lock::RwLockWriteGuard;
Re-export Entry
pub use mapref::entry::Entry;
Re-export OccupiedEntry
pub use mapref::entry::OccupiedEntry;
Re-export VacantEntry
pub use mapref::entry::VacantEntry;
Re-export ReadOnlyView
pub use read_only::ReadOnlyView;
Re-export DashSet
pub use set::DashSet;
Re-export Map
pub use t::Map;
Re-export SharedValue
pub use util::SharedValue;