noodles_vcf/header/parser/
builder.rs

1use super::{FileFormatOption, Parser};
2
3/// A VCF header parser builder.
4#[derive(Default)]
5pub struct Builder {
6    file_format_option: FileFormatOption,
7}
8
9impl Builder {
10    /// Sets the file format option.
11    pub fn set_file_format_option(mut self, file_format_option: FileFormatOption) -> Self {
12        self.file_format_option = file_format_option;
13        self
14    }
15
16    /// Builds a VCF header parser.
17    pub fn build(self) -> Parser {
18        Parser {
19            file_format_option: self.file_format_option,
20            ..Default::default()
21        }
22    }
23}
24
25#[cfg(test)]
26mod tests {
27    use super::*;
28
29    #[test]
30    fn test_default() {
31        let builder = Builder::default();
32        assert_eq!(builder.file_format_option, FileFormatOption::default());
33    }
34}