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

A VCF header map value.

Implementations§

source§

impl Map<AlternativeAllele>

source

pub fn new<D>(description: D) -> Selfwhere D: Into<String>,

Creates a VCF header alternative allele map value.

Examples
use noodles_vcf::{
    header::record::value::{map::AlternativeAllele, Map},
    record::alternate_bases::allele::{
        symbol::{structural_variant::Type, StructuralVariant},
        Symbol,
    },
};

let id = Symbol::StructuralVariant(StructuralVariant::from(Type::Deletion));
let map = Map::<AlternativeAllele>::new("Deletion");
source§

impl Map<Contig>

source

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

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

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

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

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

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

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>

source

pub fn pass() -> Self

Creates a default VCF header filter map value for “PASS”.

Examples
use noodles_vcf::header::record::value::{map::Filter, Map};
let actual = Map::<Filter>::pass();
let expected = Map::<Filter>::new("All filters passed");
assert_eq!(actual, expected);
source

pub fn new<D>(description: D) -> Selfwhere D: Into<String>,

Creates a VCF header filter map value.

Examples
use noodles_vcf::header::record::value::{map::Filter, Map};
let map = Map::<Filter>::new("Quality below 10");
source§

impl Map<Format>

source

pub fn new<D>(number: Number, ty: Type, description: D) -> Selfwhere D: Into<String>,

Creates a VCF header format map value.

Examples
use noodles_vcf::{
    header::{record::value::{map::{format::Type, Format}, Map}, Number},
    record::genotypes::keys::key,
};

let id = key::GENOTYPE;
let map = Map::<Format>::new(Number::Count(1), Type::String, "Genotype");
source§

impl Map<Info>

source

pub fn new<D>(number: Number, ty: Type, description: D) -> Selfwhere D: Into<String>,

Creates a VCF header info map value.

Examples
use noodles_vcf::{
    header::{record::value::{map::{info::Type, Info}, Map}, Number},
    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 Map<Other>

source

pub fn new() -> Self

Creates a nonstandard VCF header map value.

Examples
use noodles_vcf::header::record::value::{map::Other, Map};
let map = Map::<Other>::new();
source§

impl<I> Map<I>where I: Inner,

source

pub fn builder() -> Builder<I>

Creates a VCF header map value builder.

source

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

Returns the nonstandard fields in the map.

source§

impl<I> Map<I>where I: Typed,

source

pub fn number(&self) -> Number

Returns the cardinality of the field value.

source

pub fn number_mut(&mut self) -> &mut Number

Returns a mutable reference to the number.

source

pub fn ty(&self) -> I::Type

Returns the type of the field value.

source

pub fn type_mut(&mut self) -> &mut I::Type

Returns a mutable reference to the type.

source§

impl<I> Map<I>where I: Described,

source

pub fn description(&self) -> &str

Returns the description.

source

pub fn description_mut(&mut self) -> &mut String

Returns a mutable reference to the description.

source§

impl<I> Map<I>where I: Indexed,

source

pub fn idx(&self) -> Option<usize>

Returns the index of the ID in the dictionary of strings.

source

pub fn idx_mut(&mut self) -> &mut Option<usize>

Returns a mutable reference to the index.

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 Display for Map<AlternativeAllele>

source§

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

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

impl Display for Map<Contig>

source§

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

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

impl Display for Map<Filter>

source§

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

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

impl Display for Map<Format>

source§

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

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

impl Display for Map<Info>

source§

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

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

impl Display for Map<Other>

source§

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

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

impl From<&Key> for Map<Format>

source§

fn from(key: &Key) -> Self

Converts to this type from the input type.
source§

impl From<&Key> for Map<Info>

source§

fn from(key: &Key) -> Self

Converts to this type from the input type.
source§

impl From<(FileFormat, &Key)> for Map<Format>

source§

fn from((file_format, key): (FileFormat, &Key)) -> Self

Converts to this type from the input type.
source§

impl From<(FileFormat, &Key)> for Map<Info>

source§

fn from((file_format, key): (FileFormat, &Key)) -> Self

Converts to this type from the input type.
source§

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

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> StructuralEq for Map<I>where I: Inner,

source§

impl<I> StructuralPartialEq for Map<I>where I: Inner,

Auto Trait Implementations§

§

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

§

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

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

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

source§

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

Mutably borrows from an owned value. Read more
§

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

§

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

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

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

§

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 Twhere 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 Twhere 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> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere 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 Twhere 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