Skip to content

Commit

Permalink
vcf/variant/record: Add info fields trait
Browse files Browse the repository at this point in the history
  • Loading branch information
zaeleus committed Feb 1, 2024
1 parent f12692d commit 4238098
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
2 changes: 2 additions & 0 deletions noodles-vcf/src/variant/record.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//! Variant record.
pub mod info;

pub use self::info::Info;
20 changes: 20 additions & 0 deletions noodles-vcf/src/variant/record/info.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,23 @@
//! Variant record info fields.
pub mod field;

use std::io;

use self::field::Value;
use crate::Header;

/// Variant record info fields.
pub trait Info {
/// Returns whether there are any fields.
fn is_empty(&self) -> bool;

/// Returns the number of fields.
fn len(&self) -> usize;

/// Returns an iterator over fields.
fn iter<'a, 'h: 'a>(
&'a self,
header: &'h Header,
) -> Box<dyn Iterator<Item = io::Result<(&'a str, Option<Value<'a>>)>> + 'a>;
}

0 comments on commit 4238098

Please sign in to comment.