[][src]Struct codenano::StrandRef

pub struct StrandRef<'a, StrandLabel, DomainLabel> { /* fields omitted */ }

A pointer to a strand being built, containing a current domain and position.

Implementations

impl<'a: 'b, 'b, StrandLabel, DomainLabel> StrandRef<'a, StrandLabel, DomainLabel>[src]

pub fn id(&self) -> StrandId[src]

Retrieve the identity of the strand currently being built.

pub fn design(&mut self) -> &mut Design<StrandLabel, DomainLabel>[src]

Return self.builder

pub fn len(&self) -> usize[src]

Total (current) length of the strand being created. Adding more points will increase the length.

pub fn with_color(self, color: u32) -> Self[src]

Choose a color for this strand.

pub fn with_kelly_color(self, color: usize) -> Self[src]

Choose a color for this strand.

pub fn domains(&self) -> &[Domain<DomainLabel>][src]

List the current domains of this strand (more domains can be added later).

pub fn domains_mut(&mut self) -> &mut Vec<Domain<DomainLabel>>[src]

Gives a mutable pointer to the vector of domains.

pub fn push_domain(&mut self, domain: Domain<DomainLabel>)[src]

Push a domain onto this strand.

pub fn extend<I: Iterator<Item = Domain<DomainLabel>>>(&mut self, i: I)[src]

Extend this strand with multiple domains.

pub fn with_sequence<I: Into<Cow<'static, str>>>(self, sequence: I) -> Self[src]

Sets the sequence of this strand.

pub fn with_domain_sequence<I: Into<Cow<'static, str>>>(
    self,
    sequence: I
) -> Self
[src]

Sets the sequence of this strand.

pub fn to(self, x: isize) -> Self[src]

Move along the helix. This method can be called multiple times consecutively, but the direction of the domain is set only on the first call, subsequent calls only change the 3' end of the domain (which is the forwardmost point if self.forward is true, and the leftmost point else).

pub fn to_point(self, point: [f32; 3]) -> Self[src]

Equivalent to self.to(nucl) where nucl is the nucleotide that is the closest to the position point.

pub fn pop(self) -> Self[src]

Remove the last domain of the strand.

pub fn rev_to(self, x: isize) -> Self[src]

Change the initial point of the first domain of this strand.

pub fn with_label<L: Into<StrandLabel>>(self, label: L) -> Self[src]

Give a label to this strand.

pub fn with_domain_label<L: Into<DomainLabel>>(self, label: L) -> Self[src]

Give a label to the most recently produced domain on this strand.

pub fn next_domain_to(self, to: isize) -> Self[src]

Finish a domain, and start a new one on the same helix and at the same position.

pub fn cross<H: Into<HelixId>>(self, h: H) -> Self[src]

Move the cursor to a different helix, keeping the same current position along the axis of the helix (most meaningful when the helices are in the same plane).

pub fn cross_to<H: Into<HelixId>>(self, h: H, start: isize) -> Self[src]

Move the cursor to a different helix, at the specified position.

pub fn hflip(self, x: isize) -> Self[src]

Compute the horizontal symmetry of this strand with respect to x-coordinate x.

pub fn vflip<H: Into<HelixId>>(self, y: H) -> Self[src]

Compute the vertical symmetry of this strand with respect to y-coordinate y. Most meaningful in flat designs.

pub fn translate(self, x: isize, y: isize) -> Self[src]

Translate this strand (all domains) to a different position. x is the horizontal translation (along the axis of the helices), and y moves between helices. Most meaningful in a flat, on-grid design.

pub fn cycle(self)[src]

Ends a cyclic strands. Set self.cycle to true and link the end and the start of the strand.

pub fn reverse(self) -> Self[src]

Reverse the direction of this strand.

Auto Trait Implementations

impl<'a, StrandLabel, DomainLabel> RefUnwindSafe for StrandRef<'a, StrandLabel, DomainLabel> where
    DomainLabel: RefUnwindSafe,
    StrandLabel: RefUnwindSafe

impl<'a, StrandLabel, DomainLabel> Send for StrandRef<'a, StrandLabel, DomainLabel> where
    DomainLabel: Send,
    StrandLabel: Send

impl<'a, StrandLabel, DomainLabel> Sync for StrandRef<'a, StrandLabel, DomainLabel> where
    DomainLabel: Sync,
    StrandLabel: Sync

impl<'a, StrandLabel, DomainLabel> Unpin for StrandRef<'a, StrandLabel, DomainLabel>

impl<'a, StrandLabel, DomainLabel> !UnwindSafe for StrandRef<'a, StrandLabel, DomainLabel>

Blanket Implementations

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S where
    D: AdaptFrom<S, Swp, Dwp, T>,
    Dwp: WhitePoint,
    Swp: WhitePoint,
    T: Component + Float
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.