pub struct Interval<T> {
pub start: T,
pub end: Option<T>,
}Expand description
Inclusive interval used for nucleotide and protein locations.
§Examples
use tinyhgvs::{VariantDescription, parse_hgvs};
let variant = parse_hgvs("NP_003997.2:p.Lys23_Val25del").unwrap();
match variant.description {
VariantDescription::Protein(description) => {
let location = match description.effect {
tinyhgvs::ProteinEffect::Edit { ref location, .. } => location,
_ => unreachable!("expected protein edit"),
};
assert_eq!(location.start.residue, "Lys");
assert_eq!(location.end.as_ref().unwrap().residue, "Val");
}
VariantDescription::Nucleotide(_) => unreachable!("expected protein variant"),
}Fields§
§start: T§end: Option<T>Trait Implementations§
impl<T: Eq> Eq for Interval<T>
impl<T> StructuralPartialEq for Interval<T>
Auto Trait Implementations§
impl<T> Freeze for Interval<T>where
T: Freeze,
impl<T> RefUnwindSafe for Interval<T>where
T: RefUnwindSafe,
impl<T> Send for Interval<T>where
T: Send,
impl<T> Sync for Interval<T>where
T: Sync,
impl<T> Unpin for Interval<T>where
T: Unpin,
impl<T> UnsafeUnpin for Interval<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Interval<T>where
T: UnwindSafe,
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