Struct noodles_sam::header::record::value::map::Map

source ·
pub struct Map<I>
where I: Inner,
{ /* private fields */ }
Expand description

A SAM header record map value.

Implementations§

source§

impl Map<Header>

source

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));
source

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));
source

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>

source

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)?);
source

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);
source

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,

source

pub fn builder() -> Builder<I>

Creates a SAM header record map value.

source

pub fn other_fields(&self) -> &IndexMap<Other<I::StandardTag>, BString>

Returns the nonstandard fields in the map.

source

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> Clone for Map<I>
where I: Inner + Clone, I::StandardTag: Clone,

source§

fn clone(&self) -> Map<I>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<I> Debug for Map<I>
where I: Inner + Debug, I::StandardTag: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<I> Default for Map<I>
where I: Inner + Default,

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<I> PartialEq for Map<I>

source§

fn eq(&self, other: &Map<I>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<I> Eq for Map<I>
where I: Inner + Eq, I::StandardTag: Eq,

source§

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>
where I: Send, <I as Inner>::StandardTag: Send,

§

impl<I> Sync for Map<I>
where I: Sync, <I as Inner>::StandardTag: Sync,

§

impl<I> Unpin for Map<I>
where I: Unpin, <I as Inner>::StandardTag: Unpin,

§

impl<I> UnwindSafe for Map<I>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more