pub mod builder;
pub mod header;
pub mod program;
pub mod read_group;
pub mod reference_sequence;
pub mod tag;
pub use self::{
builder::Builder, header::Header, program::Program, read_group::ReadGroup,
reference_sequence::ReferenceSequence, tag::Tag,
};
use bstr::BString;
use indexmap::IndexMap;
pub(crate) type OtherFields<S> = IndexMap<tag::Other<S>, BString>;
pub trait Inner: Sized {
type StandardTag: tag::Standard;
type Builder: builder::Inner<Self>;
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct Map<I>
where
I: Inner,
{
pub(crate) inner: I,
pub(crate) other_fields: OtherFields<I::StandardTag>,
}
impl<I> Map<I>
where
I: Inner,
{
pub fn builder() -> Builder<I> {
Builder::default()
}
pub fn other_fields(&self) -> &OtherFields<I::StandardTag> {
&self.other_fields
}
pub fn other_fields_mut(&mut self) -> &mut OtherFields<I::StandardTag> {
&mut self.other_fields
}
}
impl<I> Default for Map<I>
where
I: Inner + Default,
{
fn default() -> Self {
Self {
inner: I::default(),
other_fields: OtherFields::new(),
}
}
}