pub struct Record { /* private fields */ }
Expand description
A FASTQ record.
Implementations§
source§impl Record
impl Record
sourcepub fn new<S, Q>(definition: Definition, sequence: S, quality_scores: Q) -> Self
pub fn new<S, Q>(definition: Definition, sequence: S, quality_scores: Q) -> Self
Creates a FASTQ record.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
sourcepub fn definition(&self) -> &Definition
pub fn definition(&self) -> &Definition
Returns the record definition.
sourcepub fn definition_mut(&mut self) -> &mut Definition
pub fn definition_mut(&mut self) -> &mut Definition
Returns a mutable reference to the record definition.
sourcepub fn name(&self) -> &BStr
pub fn name(&self) -> &BStr
Returns the name of the record.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
assert_eq!(record.name(), &b"r0"[..]);
sourcepub fn name_mut(&mut self) -> &mut BString
pub fn name_mut(&mut self) -> &mut BString
Returns a mutable reference to the name.
§Examples
use bstr::BString;
use noodles_fastq::{self as fastq, record::Definition};
let mut record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
*record.name_mut() = BString::from(b"r1");
assert_eq!(record.name(), &b"r1"[..]);
sourcepub fn description(&self) -> &BStr
pub fn description(&self) -> &BStr
Returns the description of the record.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
assert!(record.description().is_empty());
sourcepub fn description_mut(&mut self) -> &mut BString
pub fn description_mut(&mut self) -> &mut BString
Returns a mutable reference to the description.
§Examples
use bstr::BString;
use noodles_fastq::{self as fastq, record::Definition};
let mut record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
*record.description_mut() = BString::from(b"LN=4");
assert_eq!(record.description(), &b"LN=4"[..]);
sourcepub fn sequence(&self) -> &[u8] ⓘ
pub fn sequence(&self) -> &[u8] ⓘ
Returns the sequence of the record.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
assert_eq!(record.sequence(), b"AGCT");
sourcepub fn sequence_mut(&mut self) -> &mut Vec<u8> ⓘ
pub fn sequence_mut(&mut self) -> &mut Vec<u8> ⓘ
Returns a mutable reference to the sequence.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let mut record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
record.sequence_mut()[0] = b'C';
assert_eq!(record.sequence(), b"CGCT");
sourcepub fn quality_scores(&self) -> &[u8] ⓘ
pub fn quality_scores(&self) -> &[u8] ⓘ
Returns the quality scores of the record.
The encoding of these scores are considered to be unknown; and it is up to the caller to decode them, if necessary.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
assert_eq!(record.quality_scores(), b"NDLS");
sourcepub fn quality_scores_mut(&mut self) -> &mut Vec<u8> ⓘ
pub fn quality_scores_mut(&mut self) -> &mut Vec<u8> ⓘ
Returns a mutable reference to the quality scores.
The encoding of these scores are considered to be unknown; and it is up to the caller to encode/decode them, if necessary.
§Examples
use noodles_fastq::{self as fastq, record::Definition};
let mut record = fastq::Record::new(Definition::new("r0", ""), "AGCT", "NDLS");
*record.quality_scores_mut() = b"!!!!".to_vec();
assert_eq!(record.quality_scores(), b"!!!!");
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
)