Struct concread::bptree::BptreeMap [−][src]
A concurrently readable map based on a modified B+Tree structure.
This structure can be used in locations where you would otherwise us
RwLock<BTreeMap> or Mutex<BTreeMap>.
Generally, the concurrent HashMap is a better choice unless you require ordered key storage.
This is a concurrently readable structure, meaning it has transactional properties. Writers are serialised (one after the other), and readers can exist in parallel with stable views of the structure at a point in time.
This is achieved through the use of COW or MVCC. As a write occurs subsets of the tree are cloned into the writer thread and then commited later. This may cause memory usage to increase in exchange for a gain in concurrent behaviour.
Transactions can be rolled-back (aborted) without penalty by dropping
the BptreeMapWriteTxn without calling commit().
Implementations
impl<K: Clone + Ord + Debug + Sync + Send + 'static, V: Clone + Sync + Send + 'static> BptreeMap<K, V>[src]
pub fn new() -> Self[src]
Construct a new concurrent tree
pub fn read(&self) -> BptreeMapReadTxn<'_, K, V>[src]
Initiate a read transaction for the tree, concurrent to any other readers or writers.
pub fn write(&self) -> BptreeMapWriteTxn<'_, K, V>[src]
Initiate a write transaction for the tree, exclusive to this writer, and concurrently to all existing reads.
pub fn try_write(&self) -> Option<BptreeMapWriteTxn<'_, K, V>>[src]
Attempt to create a new write, returns None if another writer already exists.
Trait Implementations
impl<K: Clone + Ord + Debug + Sync + Send + 'static, V: Clone + Sync + Send + 'static> Default for BptreeMap<K, V>[src]
impl<K: Clone + Ord + Debug + Sync + Send + 'static, V: Clone + Sync + Send + 'static> FromIterator<(K, V)> for BptreeMap<K, V>[src]
fn from_iter<I: IntoIterator<Item = (K, V)>>(iter: I) -> Self[src]
impl<K: Clone + Ord + Debug + Sync + Send + 'static, V: Clone + Sync + Send + 'static> Send for BptreeMap<K, V>[src]
impl<K: Clone + Ord + Debug + Sync + Send + 'static, V: Clone + Sync + Send + 'static> Sync for BptreeMap<K, V>[src]
Auto Trait Implementations
impl<K, V> !RefUnwindSafe for BptreeMap<K, V>
impl<K, V> Unpin for BptreeMap<K, V>
impl<K, V> !UnwindSafe for BptreeMap<K, V>
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[src]
pub const ALIGN: usize[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T[src]
pub unsafe fn drop(ptr: usize)[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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,