pub struct Record { /* private fields */ }
Expand description
A FASTA index record.
Implementations§
source§impl Record
impl Record
sourcepub fn new<N>(
name: N,
length: u64,
offset: u64,
line_bases: u64,
line_width: u64,
) -> Self
pub fn new<N>( name: N, length: u64, offset: u64, line_bases: u64, line_width: u64, ) -> Self
Creates a FASTA index record.
§Examples
use noodles_fasta::fai;
let record = fai::Record::new("sq0", 8, 4, 80, 81);
sourcepub fn name(&self) -> &[u8] ⓘ
pub fn name(&self) -> &[u8] ⓘ
Returns the record name.
§Examples
use noodles_fasta::fai;
let record = fai::Record::new("sq0", 8, 4, 80, 81);
assert_eq!(record.name(), b"sq0");
sourcepub fn len(&self) -> u64
👎Deprecated since 0.23.0: Use Record::length
instead.
pub fn len(&self) -> u64
Record::length
instead.Returns the length of the sequence.
§Examples
use noodles_fasta::fai;
let record = fai::Record::new("sq0", 8, 4, 80, 81);
assert_eq!(record.len(), 8);
sourcepub fn length(&self) -> u64
pub fn length(&self) -> u64
Returns the length of the sequence.
§Examples
use noodles_fasta::fai;
let record = fai::Record::new("sq0", 8, 4, 80, 81);
assert_eq!(record.length(), 8);
sourcepub fn offset(&self) -> u64
pub fn offset(&self) -> u64
Returns the offset from the start.
§Examples
use noodles_fasta::fai;
let record = fai::Record::new("sq0", 8, 4, 80, 81);
assert_eq!(record.offset(), 4);
sourcepub fn line_bases(&self) -> u64
pub fn line_bases(&self) -> u64
Returns the number of bases in a line.
§Examples
use noodles_fasta::fai;
let record = fai::Record::new("sq0", 8, 4, 80, 81);
assert_eq!(record.line_bases(), 80);
sourcepub fn line_width(&self) -> u64
pub fn line_width(&self) -> u64
Returns the number of characters in a line.
§Examples
use noodles_fasta::fai;
let record = fai::Record::new("sq0", 8, 4, 80, 81);
assert_eq!(record.line_width(), 81);
sourcepub fn query(&self, interval: Interval) -> Result<u64>
pub fn query(&self, interval: Interval) -> Result<u64>
Returns the start position of the given interval.
§Examples
use noodles_core::{region::Interval, Position};
use noodles_fasta::fai;
let record = fai::Record::new("sq0", 10946, 4, 80, 81);
let interval = Interval::from(..);
assert_eq!(record.query(interval)?, 4);
Ok::<_, std::io::Error>(())
Trait Implementations§
impl Eq for Record
impl StructuralPartialEq for Record
Auto Trait Implementations§
impl Freeze for Record
impl RefUnwindSafe for Record
impl Send for Record
impl Sync for Record
impl Unpin for Record
impl UnwindSafe for Record
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)