#[repr(u8)]pub enum AminoAcid {
Show 21 variants
Ala = 0,
Cys = 1,
Asp = 2,
Glu = 3,
Phe = 4,
Gly = 5,
His = 6,
Ile = 7,
Lys = 8,
Leu = 9,
Met = 10,
Asn = 11,
Pro = 12,
Gln = 13,
Arg = 14,
Ser = 15,
Thr = 16,
Val = 17,
Trp = 18,
Tyr = 19,
Unknown = 20,
}Expand description
The 20 standard amino acids plus Unknown, with integer discriminants matching the conventional protein-ML encoding (Ala=0 … Unknown=20).
Variants§
Ala = 0
Cys = 1
Asp = 2
Glu = 3
Phe = 4
Gly = 5
His = 6
Ile = 7
Lys = 8
Leu = 9
Met = 10
Asn = 11
Pro = 12
Gln = 13
Arg = 14
Ser = 15
Thr = 16
Val = 17
Trp = 18
Tyr = 19
Unknown = 20
Implementations§
Source§impl AminoAcid
impl AminoAcid
Sourcepub fn from_three_letter(aa: &str) -> Self
pub fn from_three_letter(aa: &str) -> Self
Parse a three-letter code (e.g. "ALA"). Unknown/missing → Unknown.
Sourcepub fn from_one_letter(aa: char) -> Self
pub fn from_one_letter(aa: char) -> Self
Parse a one-letter code (e.g. 'A'). Unknown/missing → Unknown.
Sourcepub fn from_index(idx: u32) -> Self
pub fn from_index(idx: u32) -> Self
Parse from integer index (0–20). Out-of-range → Unknown.
Sourcepub fn one_letter(self) -> char
pub fn one_letter(self) -> char
One-letter code (e.g. 'A' for Ala, 'X' for Unknown).
Sourcepub fn three_letter(self) -> &'static str
pub fn three_letter(self) -> &'static str
Three-letter code (e.g. "ALA" for Ala, "UNK" for Unknown).
Trait Implementations§
impl Copy for AminoAcid
impl Eq for AminoAcid
Source§impl IntoEnumIterator for AminoAcid
impl IntoEnumIterator for AminoAcid
type Iterator = AminoAcidIter
fn iter() -> AminoAcidIter ⓘ
impl StructuralPartialEq for AminoAcid
Auto Trait Implementations§
impl Freeze for AminoAcid
impl RefUnwindSafe for AminoAcid
impl Send for AminoAcid
impl Sync for AminoAcid
impl Unpin for AminoAcid
impl UnsafeUnpin for AminoAcid
impl UnwindSafe for AminoAcid
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more