Struct noodles_bam::record::data::Data[][src]

pub struct Data<'a>(_);
Expand description

BAM record data.

This is also called optional fields.

Implementations

Creates data from raw data data.

Examples

use noodles_bam::record::Data;

let raw_data = [
    b'N', b'H', b'i', 0x01, 0x00, 0x00, 0x00, // NH:i:1
    b'R', b'G', b'Z', b'r', b'g', b'0', 0x00, // RG:Z:rg0
];
let data = Data::new(&raw_data);

Returns an iterator over data fields.

Examples

use noodles_bam::record::{data::{field::Value, Field}, Data};
use noodles_sam::record::data::field::Tag;

let raw_data = [
    b'N', b'H', b'i', 0x01, 0x00, 0x00, 0x00, // NH:i:1
    b'R', b'G', b'Z', b'r', b'g', b'0', 0x00, // RG:Z:rg0
];
let data = Data::new(&raw_data);

let mut fields = data.fields();

assert_eq!(
    fields.next().transpose()?,
    Some(Field::new(Tag::AlignmentHitCount, Value::Int32(1)))
);

assert_eq!(
    fields.next().transpose()?,
    Some(Field::new(Tag::ReadGroup, Value::String(String::from("rg0"))))
);

assert!(fields.next().is_none());

Trait Implementations

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

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

Performs the conversion.

Performs the conversion.

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.