Skip to main content

SortedInsertArcMutexByKey

Trait SortedInsertArcMutexByKey 

Source
pub trait SortedInsertArcMutexByKey<T>: SortedInsertArcMutexBy<T> {
    // Provided methods
    fn sorted_insert_asc_by_key<A: Ord, F: FnMut(&T) -> &A>(
        &mut self,
        element: Arc<Mutex<T>>,
        f: F,
    ) -> usize { ... }
    fn sorted_insert_desc_by_key<A: Ord, F: FnMut(&T) -> &A>(
        &mut self,
        element: Arc<Mutex<T>>,
        f: F,
    ) -> usize { ... }
}
Available on crate feature std only.

Provided Methods§

Source

fn sorted_insert_asc_by_key<A: Ord, F: FnMut(&T) -> &A>( &mut self, element: Arc<Mutex<T>>, f: F, ) -> usize

Insert an element to this sorted collection in ascending order by a specific key and return the inserted index. Use linear search to find the index where a matching element could be inserted.

§Panics

This function will panic if any involved lock is poisoned.

Source

fn sorted_insert_desc_by_key<A: Ord, F: FnMut(&T) -> &A>( &mut self, element: Arc<Mutex<T>>, f: F, ) -> usize

Insert an element to this sorted collection in descending order by a specific key and return the inserted index. Use linear search to find the index where a matching element could be inserted.

§Panics

This function will panic if any involved lock is poisoned.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<T> SortedInsertArcMutexByKey<T> for Vec<Arc<Mutex<T>>>

Source§

impl<T> SortedInsertArcMutexByKey<T> for VecDeque<Arc<Mutex<T>>>

Implementors§