Struct arc_map::ArcMap [−][src]
Methods
impl<K: MKey, V: MVal> ArcMap<K, V>
[src]
impl<K: MKey, V: MVal> ArcMap<K, V>
pub fn new() -> ArcMap<K, V>
[src]
pub fn new() -> ArcMap<K, V>
Create a new ArcMap This will spawn a guard process That process will die when the last Clone of this map is dropped
pub fn new_sized(bsize: usize) -> ArcMap<K, V>
[src]
pub fn new_sized(bsize: usize) -> ArcMap<K, V>
pub fn insert(&self, k: K, v: V) -> Result<bool, AMapErr>
[src]
pub fn insert(&self, k: K, v: V) -> Result<bool, AMapErr>
Add a new item to the map.
pub fn get(&self, k: K) -> Result<Arc<Mutex<V>>, AMapErr>
[src]
pub fn get(&self, k: K) -> Result<Arc<Mutex<V>>, AMapErr>
The basic way of getting an item out of the list for editing returns type of (wrapped) Arc means you can keep this after closing and still be safe In general prefer on_do
pub fn remove(&self, k: K) -> Result<(), AMapErr>
[src]
pub fn remove(&self, k: K) -> Result<(), AMapErr>
This function only removes the object from the list. If you have an Arc Copy that will still be valid
pub fn on_do<RT, F>(&mut self, on: K, f: F) -> Result<RT, AMapErr> where
F: FnMut(&mut V) -> RT,
[src]
pub fn on_do<RT, F>(&mut self, on: K, f: F) -> Result<RT, AMapErr> where
F: FnMut(&mut V) -> RT,
Run f on the item at the index "on", Returns the result of f wrapped in a Result Allows for reading data out of the object Errors if index not found, or channel/locking errors