logo
pub trait DistType: Copy + Debug + Default + AddAssign + SubAssign + PrimInt + FromPrimitive + ToPrimitive + AsPrimitive<usize> + AsPrimitive<i64> + WrappingAdd + Sub<Output = Self> { }
Expand description

Trait for types that should be used to store the distance score when using the simple Myers algorithm (not the block-based one, which always uses usize).

For all currently implemented BitVec types, the maximum possible distance can be stored in u8. Custom implementations using bigger integers can adjust DistType to hold bigger numbers. Note that due to how the traceback algorithm currently works, DistType should be able to represent numbers larger than the bit-width of the BitVec type. For instance, a hypothetical BitVec type of u256 should use u16 as distance, since u8 cannot store numbers larger than 255.

Implementations on Foreign Types

Implementors