pub trait TryDot<Rhs: ?Sized = Self> {
type Error;
type Output;
// Required method
fn try_dot(&self, rhs: &Rhs) -> Result<Self::Output, Self::Error>;
// Provided method
unsafe fn dot_unchecked(&self, rhs: &Rhs) -> Self::Output { ... }
}Expand description
Fallible trait for an algabraic scalar product between two possibly inequal-length sequences of numbers and returns a single value.
This largely exists to enable a safe-ish way to perform a dot product
between unsized slices, as this does come up from time-to-time.
See Dot for the infallible equivalent. This trait is to TryFrom as
Dot is to From.
See Dot Product for more information.