Trait bio::pattern_matching::myers::BitVec
source · pub trait BitVec: Copy + Default + Add + Sub + BitOr + BitOrAssign + BitAnd + BitXor + Not + Shl<usize> + ShlAssign<usize> + ShrAssign<usize> + PrimInt + WrappingAdd {
type DistType: Copy + Default + AddAssign + SubAssign + PrimInt + FromPrimitive + Bounded;
}
Expand description
This trait must be implemented for integer types serving as bit vectors. Only unsigned integers will work correctly.
Required Associated Types
sourcetype DistType: Copy + Default + AddAssign + SubAssign + PrimInt + FromPrimitive + Bounded
type DistType: Copy + Default + AddAssign + SubAssign + PrimInt + FromPrimitive + Bounded
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 represent numbers larger
than 256.