pub struct Builder<I>where
I: Inner,{ /* private fields */ }
Expand description
A SAM header record map value builder.
Implementations§
source§impl<I> Builder<I>where
I: Inner,
impl<I> Builder<I>where
I: Inner,
sourcepub fn insert<V>(self, key: Other<I::StandardTag>, value: V) -> Self
pub fn insert<V>(self, key: Other<I::StandardTag>, value: V) -> Self
Inserts a key-value pair into the other fields.
§Examples
use bstr::BString;
use noodles_sam::header::record::value::{map::{Header, Tag}, Map};
let nd = match Tag::try_from([b'n', b'd']) {
Ok(Tag::Other(tag)) => tag,
_ => unreachable!(),
};
let header = Map::<Header>::builder().insert(nd, "noodles").build()?;
assert_eq!(header.other_fields().get(b"nd"), Some(&BString::from("noodles")));
source§impl Builder<Header>
impl Builder<Header>
sourcepub fn set_version(self, version: Version) -> Self
pub fn set_version(self, version: Version) -> Self
Sets a format version.
§Examples
use noodles_sam::header::record::value::{
map::{self, header::Version},
Map,
};
let version = Version::new(1, 6);
let header = Map::<map::Header>::builder().set_version(version).build()?;
assert_eq!(header.version(), version);
source§impl Builder<ReferenceSequence>
impl Builder<ReferenceSequence>
sourcepub fn set_length(self, length: NonZeroUsize) -> Self
pub fn set_length(self, length: NonZeroUsize) -> Self
Sets a reference sequence length.
§Examples
use std::num::NonZeroUsize;
use noodles_sam::header::record::value::{map::ReferenceSequence, Map};
let length = NonZeroUsize::try_from(13)?;
let reference_sequence = Map::<ReferenceSequence>::builder()
.set_length(length)
.build()?;
assert_eq!(reference_sequence.length(), length);
Trait Implementations§
Auto Trait Implementations§
impl<I> Freeze for Builder<I>
impl<I> RefUnwindSafe for Builder<I>
impl<I> Send for Builder<I>
impl<I> Sync for Builder<I>
impl<I> Unpin for Builder<I>
impl<I> UnwindSafe for Builder<I>
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