pub enum ReqStrand {
    Forward,
    Reverse,
}
Expand description

Strand information for annotations that require a strand.

Variants§

§

Forward

§

Reverse

Implementations§

source§

impl ReqStrand

source

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)

source

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 -.

source

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 Clone for ReqStrand

source§

fn clone(&self) -> ReqStrand

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ReqStrand

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for ReqStrand

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<ReqStrand> for Strand

source§

fn from(rstr: ReqStrand) -> Self

Converts to this type from the input type.
source§

impl FromStr for ReqStrand

§

type Err = StrandError

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
source§

impl Hash for ReqStrand

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Neg for ReqStrand

§

type Output = ReqStrand

The resulting type after applying the - operator.
source§

fn neg(self) -> ReqStrand

Performs the unary - operation. Read more
source§

impl Ord for ReqStrand

source§

fn cmp(&self, other: &ReqStrand) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl PartialEq<ReqStrand> for ReqStrand

source§

fn eq(&self, other: &ReqStrand) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<ReqStrand> for ReqStrand

source§

fn partial_cmp(&self, other: &ReqStrand) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Same for ReqStrand

source§

fn same(&self, s1: &Self) -> bool

Indicate when two strands are the “same” – two unknown/unspecified strands are the “same” but are not equal.
source§

impl Copy for ReqStrand

source§

impl Eq for ReqStrand

source§

impl StructuralEq for ReqStrand

source§

impl StructuralPartialEq for ReqStrand

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.