While standard operator traits, like Add, BitAnd or Mul have generic Output types, operator traits for comparisons are restricted to bool results.
DLS APIs could be benefited from generic output types in comparators, having a trait definition like:
pub trait PartialEq<Rhs = Self> where Rhs: ?Sized {
// you could still translate Output to bool type Output: Into<bool>;
fn eq(&self, other: &Rhs) -> Self::Output;
fn ne(&self, other: &Rhs) -> Self::Output { ... }
}
With the current approach, in DLS APIs like Diesel, you must use methods to representate "equals" operator:
posts.filter(published.eq(true))
With generic output types, you could use
posts.filter(published == true)