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§
source§impl<I> PartialEq for Map<I>
impl<I> PartialEq for Map<I>
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<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.