pub struct StrandRef<'a, StrandLabel, DomainLabel> { /* private fields */ }
Expand description
A pointer to a strand being built, containing a current domain and position.
Implementations§
Source§impl<'a: 'b, 'b, StrandLabel, DomainLabel> StrandRef<'a, StrandLabel, DomainLabel>
impl<'a: 'b, 'b, StrandLabel, DomainLabel> StrandRef<'a, StrandLabel, DomainLabel>
Sourcepub fn len(&self) -> usize
pub fn len(&self) -> usize
Total (current) length of the strand being created. Adding more points will increase the length.
Sourcepub fn with_color(self, color: u32) -> Self
pub fn with_color(self, color: u32) -> Self
Choose a color for this strand.
Sourcepub fn with_kelly_color(self, color: usize) -> Self
pub fn with_kelly_color(self, color: usize) -> Self
Choose a color for this strand.
Sourcepub fn domains(&self) -> &[Domain<DomainLabel>]
pub fn domains(&self) -> &[Domain<DomainLabel>]
List the current domains of this strand (more domains can be added later).
Sourcepub fn domains_mut(&mut self) -> &mut Vec<Domain<DomainLabel>>
pub fn domains_mut(&mut self) -> &mut Vec<Domain<DomainLabel>>
Gives a mutable pointer to the vector of domains.
Sourcepub fn push_domain(&mut self, domain: Domain<DomainLabel>)
pub fn push_domain(&mut self, domain: Domain<DomainLabel>)
Push a domain onto this strand.
Sourcepub fn extend<I: Iterator<Item = Domain<DomainLabel>>>(&mut self, i: I)
pub fn extend<I: Iterator<Item = Domain<DomainLabel>>>(&mut self, i: I)
Extend this strand with multiple domains.
Sourcepub fn with_sequence<I: Into<Cow<'static, str>>>(self, sequence: I) -> Self
pub fn with_sequence<I: Into<Cow<'static, str>>>(self, sequence: I) -> Self
Sets the sequence of this strand.
Sourcepub fn with_domain_sequence<I: Into<Cow<'static, str>>>(
self,
sequence: I,
) -> Self
pub fn with_domain_sequence<I: Into<Cow<'static, str>>>( self, sequence: I, ) -> Self
Sets the sequence of this strand.
Sourcepub fn to(self, x: isize) -> Self
pub fn to(self, x: isize) -> Self
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).
Sourcepub fn to_point(self, point: [f32; 3]) -> Self
pub fn to_point(self, point: [f32; 3]) -> Self
Equivalent to self.to(nucl)
where nucl
is the nucleotide
that is the closest to the position point
.
Sourcepub fn rev_to(self, x: isize) -> Self
pub fn rev_to(self, x: isize) -> Self
Change the initial point of the first domain of this strand.
Sourcepub fn with_label<L: Into<StrandLabel>>(self, label: L) -> Self
pub fn with_label<L: Into<StrandLabel>>(self, label: L) -> Self
Give a label to this strand.
Sourcepub fn with_domain_label<L: Into<DomainLabel>>(self, label: L) -> Self
pub fn with_domain_label<L: Into<DomainLabel>>(self, label: L) -> Self
Give a label to the most recently produced domain on this strand.
Sourcepub fn next_domain_to(self, to: isize) -> Self
pub fn next_domain_to(self, to: isize) -> Self
Finish a domain, and start a new one on the same helix and at the same position.
Sourcepub fn cross<H: Into<HelixId>>(self, h: H) -> Self
pub fn cross<H: Into<HelixId>>(self, h: H) -> Self
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).
Sourcepub fn cross_to<H: Into<HelixId>>(self, h: H, start: isize) -> Self
pub fn cross_to<H: Into<HelixId>>(self, h: H, start: isize) -> Self
Move the cursor to a different helix, at the specified position.
Sourcepub fn hflip(self, x: isize) -> Self
pub fn hflip(self, x: isize) -> Self
Compute the horizontal symmetry of this strand with respect to
x-coordinate x
.
Sourcepub fn vflip<H: Into<HelixId>>(self, y: H) -> Self
pub fn vflip<H: Into<HelixId>>(self, y: H) -> Self
Compute the vertical symmetry of this strand with respect to
y-coordinate y
. Most meaningful in flat designs.
Sourcepub fn translate(self, x: isize, y: isize) -> Self
pub fn translate(self, x: isize, y: isize) -> Self
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.
Auto Trait Implementations§
impl<'a, StrandLabel, DomainLabel> Freeze for StrandRef<'a, StrandLabel, DomainLabel>
impl<'a, StrandLabel, DomainLabel> RefUnwindSafe for StrandRef<'a, StrandLabel, DomainLabel>where
StrandLabel: RefUnwindSafe,
DomainLabel: RefUnwindSafe,
impl<'a, StrandLabel, DomainLabel> Send for StrandRef<'a, StrandLabel, DomainLabel>
impl<'a, StrandLabel, DomainLabel> Sync for StrandRef<'a, StrandLabel, DomainLabel>
impl<'a, StrandLabel, DomainLabel> Unpin for StrandRef<'a, StrandLabel, DomainLabel>
impl<'a, StrandLabel, DomainLabel> !UnwindSafe for StrandRef<'a, StrandLabel, DomainLabel>
Blanket Implementations§
Source§impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
Source§fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<Swp, Dwp, T>,
Source§fn adapt_into(self) -> D
fn adapt_into(self) -> D
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more