Skip to main content

noodles_bed/feature/
record.rs

1//! Feature record.
2
3pub mod other_fields;
4mod strand;
5
6use std::io;
7
8use bstr::BStr;
9use noodles_core::Position;
10
11pub use self::{other_fields::OtherFields, strand::Strand};
12
13/// A feature record.
14pub trait Record<const N: usize> {
15    /// Return the number of standard fields.
16    fn standard_field_count(&self) -> usize {
17        N
18    }
19
20    /// Returns the reference sequence name.
21    fn reference_sequence_name(&self) -> &BStr;
22
23    /// Returns the feature start.
24    fn feature_start(&self) -> io::Result<Position>;
25
26    /// Returns the feature end.
27    fn feature_end(&self) -> Option<io::Result<Position>>;
28
29    /// Returns the name.
30    fn name(&self) -> Option<Option<&BStr>>;
31
32    /// Returns the score.
33    fn score(&self) -> Option<io::Result<u16>>;
34
35    /// Returns the strand.
36    fn strand(&self) -> Option<io::Result<Option<Strand>>>;
37
38    /// Returns the other fields.
39    fn other_fields(&self) -> Box<dyn OtherFields + '_>;
40}