Struct noodles::vcf::header::Contig[][src]

pub struct Contig { /* fields omitted */ }
Expand description

A VCF header contig record (contig).

Implementations

Creates a VCF header contig record.

Examples

use noodles_vcf::header::Contig;
let contig = Contig::new("sq0");

Returns the ID of the contig.

Examples

use noodles_vcf::header::Contig;
let contig = Contig::new("sq0");
assert_eq!(contig.id(), "sq0");

Returns the length of the contig, if it is set.

Examples

use noodles_vcf::header::Contig;
let contig = Contig::new("sq0");
assert_eq!(contig.len(), None);

Returns the value of the field with the given key.

Examples

use std::convert::TryFrom;
use noodles_vcf::header::{contig, record, Record, Contig};

let record = Record::new(
    record::Key::Contig,
    record::Value::Struct(vec![
        (String::from("ID"), String::from("sq0")),
        (String::from("md5"), String::from("d7eba311421bbc9d3ada44709dd61534")),
    ]),
);
let contig = Contig::try_from(record)?;

assert_eq!(contig.get("md5"), Some("d7eba311421bbc9d3ada44709dd61534"));
assert!(contig.get("species").is_none());

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

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

Performs the conversion.

Performs the conversion.

Should always be Self

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.