pub struct Map<I>where
I: Inner,{ /* private fields */ }
Expand description
A VCF header map value.
Implementations§
Source§impl Map<AlternativeAllele>
impl Map<AlternativeAllele>
Source§impl Map<Contig>
impl Map<Contig>
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a VCF header contig map value.
§Examples
use noodles_vcf::header::record::value::{map::Contig, Map};
let map = Map::<Contig>::new();
Sourcepub fn length(&self) -> Option<usize>
pub fn length(&self) -> Option<usize>
Returns the length.
§Examples
use noodles_vcf::header::record::value::{map::Contig, Map};
let map = Map::<Contig>::new();
assert!(map.length().is_none());
Sourcepub fn length_mut(&mut self) -> &mut Option<usize>
pub fn length_mut(&mut self) -> &mut Option<usize>
Returns a mutable reference to the length.
§Examples
use noodles_vcf::header::record::value::{map::Contig, Map};
let mut map = Map::<Contig>::new();
assert!(map.length().is_none());
*map.length_mut() = Some(8);
assert_eq!(map.length(), Some(8));
Sourcepub fn md5(&self) -> Option<&str>
pub fn md5(&self) -> Option<&str>
Returns the MD5 hexdigest.
§Examples
use noodles_vcf::header::record::value::{map::Contig, Map};
let map = Map::<Contig>::new();
assert!(map.md5().is_none());
Sourcepub fn md5_mut(&mut self) -> &mut Option<String>
pub fn md5_mut(&mut self) -> &mut Option<String>
Returns a mutable reference to the MD5 hexdigest.
§Examples
use noodles_vcf::header::record::value::{map::Contig, Map};
let mut map = Map::<Contig>::new();
assert!(map.md5().is_none());
*map.md5_mut() = Some(String::from("d7eba311421bbc9d3ada44709dd61534"));
assert_eq!(map.md5(), Some("d7eba311421bbc9d3ada44709dd61534"));
Sourcepub fn url(&self) -> Option<&str>
pub fn url(&self) -> Option<&str>
Returns the URL.
§Examples
use noodles_vcf::header::record::value::{map::Contig, Map};
let map = Map::<Contig>::new();
assert!(map.url().is_none());
Sourcepub fn url_mut(&mut self) -> &mut Option<String>
pub fn url_mut(&mut self) -> &mut Option<String>
Returns a mutable reference to the URL.
§Examples
use noodles_vcf::header::record::value::{map::Contig, Map};
let mut map = Map::<Contig>::new();
assert!(map.url().is_none());
*map.url_mut() = Some(String::from("https://example.com/reference.fa"));
assert_eq!(map.url(), Some("https://example.com/reference.fa"));
Source§impl Map<Filter>
impl Map<Filter>
Source§impl Map<Format>
impl Map<Format>
Sourcepub fn new<D>(number: Number, ty: Type, description: D) -> Self
pub fn new<D>(number: Number, ty: Type, description: D) -> Self
Creates a VCF header format map value.
§Examples
use noodles_vcf::{
header::record::value::{map::{format::{Number, Type}, Format}, Map},
variant::record::samples::keys::key,
};
let id = key::GENOTYPE;
let map = Map::<Format>::new(Number::Count(1), Type::String, "Genotype");
Source§impl Map<Info>
impl Map<Info>
Sourcepub fn new<D>(number: Number, ty: Type, description: D) -> Self
pub fn new<D>(number: Number, ty: Type, description: D) -> Self
Creates a VCF header info map value.
§Examples
use noodles_vcf::{
header::record::value::{map::{info::{Number, Type}, Info}, Map},
variant::record::info::field::key,
};
let id = key::SAMPLES_WITH_DATA_COUNT;
let map = Map::<Info>::new(
Number::Count(1),
Type::Integer,
"Number of samples with data",
);
Source§impl<I> Map<I>where
I: Inner,
impl<I> Map<I>where
I: Inner,
Sourcepub fn other_fields(&self) -> &IndexMap<Other<I::StandardTag>, String>
pub fn other_fields(&self) -> &IndexMap<Other<I::StandardTag>, String>
Returns the nonstandard fields in the map.
Sourcepub fn other_fields_mut(
&mut self,
) -> &mut IndexMap<Other<I::StandardTag>, String>
pub fn other_fields_mut( &mut self, ) -> &mut IndexMap<Other<I::StandardTag>, String>
Returns a mutable reference to the nonstandard fields in the map.
§Examples
use noodles_vcf::header::record::value::{map::Filter, Map};
let tag = match "noodles".parse() {
Ok(tag) => tag,
Err(_) => unreachable!(),
};
let mut map = Map::<Filter>::pass();
map.other_fields_mut().insert(tag, String::from("vcf"));
Source§impl<I> Map<I>where
I: Typed,
impl<I> Map<I>where
I: Typed,
Sourcepub fn number_mut(&mut self) -> &mut I::Number
pub fn number_mut(&mut self) -> &mut I::Number
Returns a mutable reference to the number.
Source§impl<I> Map<I>where
I: Described,
impl<I> Map<I>where
I: Described,
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Returns the description.
Sourcepub fn description_mut(&mut self) -> &mut String
pub fn description_mut(&mut self) -> &mut String
Returns a mutable reference to the description.
Trait Implementations§
Source§impl From<(FileFormat, &str)> for Map<Format>
impl From<(FileFormat, &str)> for Map<Format>
Source§fn from((file_format, key): (FileFormat, &str)) -> Self
fn from((file_format, key): (FileFormat, &str)) -> Self
Converts to this type from the input type.
Source§impl From<(FileFormat, &str)> for Map<Info>
impl From<(FileFormat, &str)> for Map<Info>
Source§fn from((file_format, key): (FileFormat, &str)) -> Self
fn from((file_format, key): (FileFormat, &str)) -> Self
Converts to this type from the input type.
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.