Skip to main content

Matrix

Trait Matrix 

Source
pub trait Matrix {
    const NULL: u8;

    // Required methods
    fn new() -> Self;
    fn set(&mut self, a: u8, b: u8, score: i8);
    fn get(&self, a: u8, b: u8) -> i8;
    fn as_ptr(&self, i: usize) -> *const i8;
    unsafe fn get_scores(&self, c: u8, v: HalfSimd, right: bool) -> Simd;
    fn convert_char(c: u8) -> u8;
}

Required Associated Constants§

Source

const NULL: u8

Byte to use as padding.

Required Methods§

Source

fn new() -> Self

Create a new matrix with default (usually nonsense) values.

Use new_simple to create a sensible scoring matrix.

Source

fn set(&mut self, a: u8, b: u8, score: i8)

Set the score for a pair of bytes.

Source

fn get(&self, a: u8, b: u8) -> i8

Get the score for a pair of bytes.

Source

fn as_ptr(&self, i: usize) -> *const i8

Get the pointer for a specific index.

Source

unsafe fn get_scores(&self, c: u8, v: HalfSimd, right: bool) -> Simd

Get the scores for a certain byte and a certain SIMD vector of bytes.

Source

fn convert_char(c: u8) -> u8

Convert a byte to a better storage format that makes retrieving scores easier.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§