Skip to main content

deepbiop_fq/encode/
record.rs

1use bstr::BString;
2
3#[derive(Debug, Default)]
4pub struct RecordData {
5    pub id: BString,
6    pub seq: BString,
7    pub qual: BString,
8}
9
10impl RecordData {
11    pub fn new(id: BString, seq: BString, qual: BString) -> Self {
12        Self { id, seq, qual }
13    }
14}
15
16impl From<(Vec<u8>, Vec<u8>, Vec<u8>)> for RecordData {
17    fn from(data: (Vec<u8>, Vec<u8>, Vec<u8>)) -> Self {
18        Self::new(data.0.into(), data.1.into(), data.2.into())
19    }
20}
21
22impl From<(BString, BString, BString)> for RecordData {
23    fn from(data: (BString, BString, BString)) -> Self {
24        Self::new(data.0, data.1, data.2)
25    }
26}