pub struct Region(/* private fields */);Expand description
A checked zero-based, half-open region. Construction is only through checked methods.
JSON retains the tagged linear / circular_arc representation.
ⓘ
use dnagent_domain::{Position, Region};
let invalid = Region::Linear { start: Position::new(9), end: Position::new(2) };Implementations§
Source§impl Region
impl Region
Sourcepub fn linear(
start: usize,
end: usize,
molecule_length: usize,
) -> Result<Self, DomainError>
pub fn linear( start: usize, end: usize, molecule_length: usize, ) -> Result<Self, DomainError>
Construct a checked linear interval.
Sourcepub fn circular_arc(
start: usize,
length: usize,
molecule_length: usize,
) -> Result<Self, DomainError>
pub fn circular_arc( start: usize, length: usize, molecule_length: usize, ) -> Result<Self, DomainError>
Construct a checked circular arc.
Sourcepub const fn is_circular_arc(&self) -> bool
pub const fn is_circular_arc(&self) -> bool
Whether this region requires circular topology.
Trait Implementations§
impl Eq for Region
impl StructuralPartialEq for Region
Auto Trait Implementations§
impl Freeze for Region
impl RefUnwindSafe for Region
impl Send for Region
impl Sync for Region
impl Unpin for Region
impl UnsafeUnpin for Region
impl UnwindSafe for Region
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