noodles_vcf/variant/record/
info.rs1pub mod field;
4
5use std::io;
6
7use self::field::Value;
8use crate::Header;
9
10pub trait Info {
12 fn is_empty(&self) -> bool;
14
15 fn len(&self) -> usize;
17
18 fn get<'a, 'h: 'a>(
20 &'a self,
21 header: &'h Header,
22 key: &str,
23 ) -> Option<io::Result<Option<Value<'a>>>>;
24
25 fn iter<'a, 'h: 'a>(
27 &'a self,
28 header: &'h Header,
29 ) -> Box<dyn Iterator<Item = io::Result<(&'a str, Option<Value<'a>>)>> + 'a>;
30}
31
32impl Info for Box<dyn Info + '_> {
33 fn is_empty(&self) -> bool {
34 (**self).is_empty()
35 }
36
37 fn len(&self) -> usize {
38 (**self).len()
39 }
40
41 fn get<'a, 'h: 'a>(
42 &'a self,
43 header: &'h Header,
44 key: &str,
45 ) -> Option<io::Result<Option<Value<'a>>>> {
46 (**self).get(header, key)
47 }
48
49 fn iter<'a, 'h: 'a>(
50 &'a self,
51 header: &'h Header,
52 ) -> Box<dyn Iterator<Item = io::Result<(&'a str, Option<Value<'a>>)>> + 'a> {
53 (**self).iter(header)
54 }
55}