[−][src]Function classific::eq_by_with
pub fn eq_by_with<S, T: ?Sized, F, C>(map: F, eq: C) -> EqByWith<S, T, F, C> where
S: ?Sized,
T: PartialEq<T>,
F: Fn(&S) -> T,
C: EqClass<T>,
This function returns an EqClass
for S
which first maps values to T
then compare them with PartialEq::eq
.
Examples
use classific::{EqClass, eq_by}; assert!(eq_by(|t: &(i8, i8)| t.1).eq(&(1, 2), &(3, 2)));