pub struct ComparisonMatrix<T: Clone + Debug + Eq + Hash + Send + Sync + 'static> { /* private fields */ }Expand description
Matrix storing pairwise comparison results between items
Implementations§
Source§impl<T: Clone + Debug + Eq + Hash + Display + Send + Sync + 'static> ComparisonMatrix<T>
impl<T: Clone + Debug + Eq + Hash + Display + Send + Sync + 'static> ComparisonMatrix<T>
pub fn new(items: &[T]) -> Self
pub fn add_comparison( &mut self, comparison: &Comparison<T>, ) -> Result<(), AsapError<T>>
pub fn get_win_count( &self, item_i: &T, item_j: &T, ) -> Result<usize, AsapError<T>>
pub fn get_comparison_count( &self, item_i: &T, item_j: &T, ) -> Result<usize, AsapError<T>>
pub fn item_count(&self) -> usize
pub fn total_comparisons(&self) -> usize
pub fn items(&self) -> Vec<T>
pub fn get_item_index(&self, item: &T) -> Result<usize, AsapError<T>>
pub fn get_item_from_index(&self, index: usize) -> Option<T>
pub fn add_item(&mut self, item: T) -> Result<(), AsapError<T>>
pub fn remove_item(&mut self, item_to_remove: &T) -> Result<(), AsapError<T>>
Trait Implementations§
Source§impl<T: Clone + Clone + Debug + Eq + Hash + Send + Sync + 'static> Clone for ComparisonMatrix<T>
impl<T: Clone + Clone + Debug + Eq + Hash + Send + Sync + 'static> Clone for ComparisonMatrix<T>
Source§fn clone(&self) -> ComparisonMatrix<T>
fn clone(&self) -> ComparisonMatrix<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T: Debug + Clone + Debug + Eq + Hash + Send + Sync + 'static> Debug for ComparisonMatrix<T>
impl<T: Debug + Clone + Debug + Eq + Hash + Send + Sync + 'static> Debug for ComparisonMatrix<T>
Source§impl<'de, T> Deserialize<'de> for ComparisonMatrix<T>
impl<'de, T> Deserialize<'de> for ComparisonMatrix<T>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl<T> Freeze for ComparisonMatrix<T>
impl<T> RefUnwindSafe for ComparisonMatrix<T>where
T: RefUnwindSafe,
impl<T> Send for ComparisonMatrix<T>
impl<T> Sync for ComparisonMatrix<T>
impl<T> Unpin for ComparisonMatrix<T>where
T: Unpin,
impl<T> UnsafeUnpin for ComparisonMatrix<T>
impl<T> UnwindSafe for ComparisonMatrix<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more