Struct noodles_csi::binning_index::index::reference_sequence::bin::Chunk
source · pub struct Chunk { /* private fields */ }
Expand description
An index reference sequence bin chunk.
A chunk is a range of virtual positions representing [start, end).
Implementations§
source§impl Chunk
impl Chunk
sourcepub fn new(start: VirtualPosition, end: VirtualPosition) -> Self
pub fn new(start: VirtualPosition, end: VirtualPosition) -> Self
Creates a new chunk.
§Examples
use noodles_bgzf as bgzf;
use noodles_csi::binning_index::index::reference_sequence::bin::Chunk;
let chunk = Chunk::new(bgzf::VirtualPosition::from(8), bgzf::VirtualPosition::from(13));
sourcepub fn start(&self) -> VirtualPosition
pub fn start(&self) -> VirtualPosition
Returns the chunk start (inclusive) as a virtual position.
§Examples
use noodles_bgzf as bgzf;
use noodles_csi::binning_index::index::reference_sequence::bin::Chunk;
let chunk = Chunk::new(bgzf::VirtualPosition::from(8), bgzf::VirtualPosition::from(13));
assert_eq!(chunk.start(), bgzf::VirtualPosition::from(8));
sourcepub fn end(&self) -> VirtualPosition
pub fn end(&self) -> VirtualPosition
Returns the chunk end (exclusive) as a virtual position.
§Examples
use noodles_bgzf as bgzf;
use noodles_csi::binning_index::index::reference_sequence::bin::Chunk;
let chunk = Chunk::new(bgzf::VirtualPosition::from(8), bgzf::VirtualPosition::from(13));
assert_eq!(chunk.end(), bgzf::VirtualPosition::from(13));
Trait Implementations§
source§impl From<Range<VirtualPosition>> for Chunk
impl From<Range<VirtualPosition>> for Chunk
source§fn from(range: Range<VirtualPosition>) -> Self
fn from(range: Range<VirtualPosition>) -> Self
Converts to this type from the input type.
source§impl PartialEq for Chunk
impl PartialEq for Chunk
impl Copy for Chunk
impl Eq for Chunk
impl StructuralPartialEq for Chunk
Auto Trait Implementations§
impl Freeze for Chunk
impl RefUnwindSafe for Chunk
impl Send for Chunk
impl Sync for Chunk
impl Unpin for Chunk
impl UnwindSafe for Chunk
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.