Skip to main content

AlphaExt

Trait AlphaExt 

Source
pub trait AlphaExt {
    // Required method
    fn to_idx(self) -> usize;
}
Expand description

ASCII 英字を 0..26 の添字へ変換します。

char と u8 に実装されています。大文字・小文字の ASCII 英字にだけ使用してください。 それ以外の値に対する変換結果は定義された用途を持ちません。

Required Methods§

Source

fn to_idx(self) -> usize

ASCII 英字を大文字・小文字を区別しない添字へ変換します。

a または A は 0、z または Z は 25 です。呼び出し側は self が ASCII 英字であることを 保証してください。

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl AlphaExt for char

Source§

fn to_idx(self) -> usize

Source§

impl AlphaExt for u8

Source§

fn to_idx(self) -> usize

Implementors§