pub enum ReqStrand {
Forward,
Reverse,
}
Expand description
Strand information for annotations that require a strand.
Variants§
Implementations§
source§impl ReqStrand
impl ReqStrand
sourcepub fn from_char(strand_char: &char) -> Result<ReqStrand, StrandError>
pub fn from_char(strand_char: &char) -> Result<ReqStrand, StrandError>
Returns a ReqStrand
enum representing the given char.
The mapping is as follows:
* ‘+’, ‘f’, or ‘F’ becomes Strand::Forward
* ‘-’, ‘r’, or ‘R’ becomes Strand::Reverse
* Any other inputs will return an Err(StrandError::InvalidChar)
sourcepub fn strand_symbol(&self) -> &str
pub fn strand_symbol(&self) -> &str
Symbol denoting the strand. By convention, in BED and GFF
files, the forward strand is +
and the reverse strand is -
.
sourcepub fn on_strand<T>(&self, x: T) -> Twhere
T: Neg<Output = T>,
pub fn on_strand<T>(&self, x: T) -> Twhere
T: Neg<Output = T>,
Convert the (optional) strand of some other annotation
according to this strand. That is, reverse the strand of the
other annotation for ReqStrand::Reverse
and leave it
unchanged for ReqStrand::Forward
.
§Arguments
x
is the strand information from some other annotation.
use bio_types::strand::{ReqStrand,Strand};
assert_eq!(ReqStrand::Forward.on_strand(Strand::Reverse),
ReqStrand::Reverse.on_strand(Strand::Forward));
Trait Implementations§
source§impl Ord for ReqStrand
impl Ord for ReqStrand
source§impl PartialOrd for ReqStrand
impl PartialOrd for ReqStrand
impl Copy for ReqStrand
impl Eq for ReqStrand
impl StructuralPartialEq for ReqStrand
Auto Trait Implementations§
impl Freeze for ReqStrand
impl RefUnwindSafe for ReqStrand
impl Send for ReqStrand
impl Sync for ReqStrand
impl Unpin for ReqStrand
impl UnwindSafe for ReqStrand
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)