pub enum AminoAcid {
Show 21 variants
Ter,
A,
C,
D,
E,
F,
G,
H,
I,
K,
L,
M,
N,
P,
Q,
R,
S,
T,
V,
W,
Y,
}
Expand description
Enum of all standard amino acids
Use the single-letter code to create AminoAcid
instances, except for the Termination codon, wich uses Ter
§Examples
use atglib::models::AminoAcid;
// derive from `slice`
assert_eq!(AminoAcid::M, AminoAcid::try_from("Met").unwrap());
assert_eq!(AminoAcid::M, AminoAcid::try_from("M").unwrap());
// derive from `char`
assert_eq!(AminoAcid::Ter, AminoAcid::try_from('*').unwrap());
// the `Display` and `as_ref` traits return the three letter code
assert_eq!(format!("{}", AminoAcid::A), "Ala".to_string());
assert_eq!(AminoAcid::A.as_ref(), "Ala".to_string());
// Get the single-letter code
assert_eq!(AminoAcid::A.single_letter(), 'A');
Variants§
Implementations§
Trait Implementations§
impl Copy for AminoAcid
impl Eq for AminoAcid
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 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