Struct noodles_vcf::header::contig::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 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
Auto Trait Implementations
impl RefUnwindSafe for Contig
impl UnwindSafe for Contig
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.