pub struct Builder { /* private fields */ }
Expand description
A SAM header program builder.
Implementations
sourceimpl Builder
impl Builder
sourcepub fn set_id<I>(self, id: I) -> Self where
I: Into<String>,
pub fn set_id<I>(self, id: I) -> Self where
I: Into<String>,
Sets a program ID.
Examples
use noodles_sam::header::Program;
let program = Program::builder().set_id("pg0").build()?;
assert_eq!(program.id(), "pg0");
sourcepub fn set_name<I>(self, name: I) -> Self where
I: Into<String>,
pub fn set_name<I>(self, name: I) -> Self where
I: Into<String>,
Sets a program name.
Examples
use noodles_sam::header::Program;
let program = Program::builder()
.set_id("pg0")
.set_name("noodles")
.build()?;
assert_eq!(program.name(), Some("noodles"));
sourcepub fn set_command_line<I>(self, command_line: I) -> Self where
I: Into<String>,
pub fn set_command_line<I>(self, command_line: I) -> Self where
I: Into<String>,
Sets a command line.
Examples
use noodles_sam::header::Program;
let program = Program::builder()
.set_id("pg0")
.set_command_line("cargo run")
.build()?;
assert_eq!(program.command_line(), Some("cargo run"));
sourcepub fn set_previous_id<I>(self, previous_id: I) -> Self where
I: Into<String>,
pub fn set_previous_id<I>(self, previous_id: I) -> Self where
I: Into<String>,
Sets a previous program ID.
Examples
use noodles_sam::header::Program;
let program = Program::builder()
.set_id("pg1")
.set_previous_id("pg0")
.build()?;
assert_eq!(program.previous_id(), Some("pg0"));
sourcepub fn set_description<I>(self, description: I) -> Self where
I: Into<String>,
pub fn set_description<I>(self, description: I) -> Self where
I: Into<String>,
Sets a description.
Examples
use noodles_sam::header::Program;
let program = Program::builder()
.set_id("pg0")
.set_description("noodles")
.build()?;
assert_eq!(program.description(), Some("noodles"));
sourcepub fn set_version<I>(self, version: I) -> Self where
I: Into<String>,
pub fn set_version<I>(self, version: I) -> Self where
I: Into<String>,
Sets a program version.
Examples
use noodles_sam::header::Program;
let program = Program::builder()
.set_id("pg0")
.set_version("0.1.0")
.build()?;
assert_eq!(program.version(), Some("0.1.0"));
sourcepub fn insert<I>(self, tag: Tag, value: I) -> Self where
I: Into<String>,
pub fn insert<I>(self, tag: Tag, value: I) -> Self where
I: Into<String>,
Inserts a tag-raw value pair.
Examples
use noodles_sam::header::{program::Tag, Program};
let zn = Tag::Other([b'z', b'n']);
let program = Program::builder()
.set_id("pg0")
.insert(zn, "noodles")
.build()?;
assert_eq!(program.fields().get(&zn), Some(&String::from("noodles")));
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnwindSafe for Builder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more