pub struct Map<I>where
I: Inner,{ /* private fields */ }
Expand description
A SAM header record map value.
Implementations§
Source§impl Map<Header>
impl Map<Header>
Sourcepub fn new(version: Version) -> Self
pub fn new(version: Version) -> Self
Creates a SAM header record header map value with a format version.
§Examples
use noodles_sam::header::record::value::{
map::{self, header::Version},
Map,
};
let header = Map::<map::Header>::new(Version::new(1, 6));
Sourcepub fn version(&self) -> Version
pub fn version(&self) -> Version
Returns the format version.
§Examples
use noodles_sam::header::record::value::{
map::{self, header::Version},
Map,
};
let header = Map::<map::Header>::new(Version::new(1, 6));
assert_eq!(header.version(), Version::new(1, 6));
Sourcepub fn version_mut(&mut self) -> &mut Version
pub fn version_mut(&mut self) -> &mut Version
Returns a mutable reference to the format version.
§Examples
use noodles_sam::header::record::value::{map::{self, header::Version}, Map};
let mut header = Map::<map::Header>::default();
*header.version_mut() = Version::new(1, 5);
assert_eq!(header.version(), Version::new(1, 5));
Source§impl Map<ReferenceSequence>
impl Map<ReferenceSequence>
Sourcepub fn new(length: NonZeroUsize) -> Self
pub fn new(length: NonZeroUsize) -> Self
Creates a reference sequence with a length.
§Examples
use std::num::NonZeroUsize;
use noodles_sam::header::record::value::{map::ReferenceSequence, Map};
let reference_sequence = Map::<ReferenceSequence>::new(NonZeroUsize::try_from(13)?);
Sourcepub fn length(&self) -> NonZeroUsize
pub fn length(&self) -> NonZeroUsize
Returns the reference sequence length.
§Examples
use std::num::NonZeroUsize;
use noodles_sam::header::record::value::{map::ReferenceSequence, Map};
let reference_sequence = Map::<ReferenceSequence>::new(NonZeroUsize::try_from(13)?);
assert_eq!(usize::from(reference_sequence.length()), 13);
Sourcepub fn length_mut(&mut self) -> &mut NonZeroUsize
pub fn length_mut(&mut self) -> &mut NonZeroUsize
Returns a mutable reference to the reference sequence length.
§Examples
use std::num::NonZeroUsize;
use noodles_sam::header::record::value::{map::ReferenceSequence, Map};
let length = NonZeroUsize::try_from(13)?;
let mut reference_sequence = Map::<ReferenceSequence>::new(length);
assert_eq!(reference_sequence.length(), length);
let length = NonZeroUsize::try_from(8)?;
*reference_sequence.length_mut() = length;
assert_eq!(reference_sequence.length(), length);
Source§impl<I> Map<I>where
I: Inner,
impl<I> Map<I>where
I: Inner,
Sourcepub fn other_fields(&self) -> &IndexMap<Other<I::StandardTag>, BString>
pub fn other_fields(&self) -> &IndexMap<Other<I::StandardTag>, BString>
Returns the nonstandard fields in the map.
Sourcepub fn other_fields_mut(
&mut self,
) -> &mut IndexMap<Other<I::StandardTag>, BString>
pub fn other_fields_mut( &mut self, ) -> &mut IndexMap<Other<I::StandardTag>, BString>
Returns a mutable reference to the nonstandard fields in the map.
§Example
use bstr::BString;
use noodles_sam::header::record::value::{map::{tag, Header}, Map};
let mut map = Map::<Header>::new(Default::default());
let nd = tag::Other::try_from([b'n', b'd'])?;
map.other_fields_mut().insert(nd, BString::from("noodles"));
Trait Implementations§
impl<I> Eq for Map<I>
impl<I> StructuralPartialEq for Map<I>where
I: Inner,
Auto Trait Implementations§
impl<I> Freeze for Map<I>where
I: Freeze,
impl<I> RefUnwindSafe for Map<I>
impl<I> Send for Map<I>
impl<I> Sync for Map<I>
impl<I> Unpin for Map<I>
impl<I> UnwindSafe for Map<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
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
)Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.