pub struct Header {
pub inner: *mut bcf_hdr_t,
pub subset: Option<SampleSubset>,
}
Expand description
A BCF header.
Fields§
§inner: *mut bcf_hdr_t
§subset: Option<SampleSubset>
Implementations§
Source§impl Header
impl Header
Sourcepub fn from_template(header: &HeaderView) -> Self
pub fn from_template(header: &HeaderView) -> Self
Create a new Header
using the given HeaderView
as the template.
After construction, you can modify the header independently from the template header
.
§Arguments
header
- TheHeaderView
to use as the template.
Sourcepub fn from_template_subset(
header: &HeaderView,
samples: &[&[u8]],
) -> Result<Self>
pub fn from_template_subset( header: &HeaderView, samples: &[&[u8]], ) -> Result<Self>
Create a new Header
using the given HeaderView
as as template, but subsetting to the
given samples
.
§Arguments
header
- TheHeaderView
to use for the template.samples
- A slice of byte-encoded ([u8]
) sample names.
Sourcepub fn push_sample(&mut self, sample: &[u8]) -> &mut Self
pub fn push_sample(&mut self, sample: &[u8]) -> &mut Self
Add a sample
to the header.
§Arguments
sample
- Name of the sample to add (to the end of the sample list).
Sourcepub fn push_record(&mut self, record: &[u8]) -> &mut Self
pub fn push_record(&mut self, record: &[u8]) -> &mut Self
Sourcepub fn remove_filter(&mut self, tag: &[u8]) -> &mut Self
pub fn remove_filter(&mut self, tag: &[u8]) -> &mut Self
Sourcepub fn remove_info(&mut self, tag: &[u8]) -> &mut Self
pub fn remove_info(&mut self, tag: &[u8]) -> &mut Self
Sourcepub fn remove_format(&mut self, tag: &[u8]) -> &mut Self
pub fn remove_format(&mut self, tag: &[u8]) -> &mut Self
Sourcepub fn remove_contig(&mut self, tag: &[u8]) -> &mut Self
pub fn remove_contig(&mut self, tag: &[u8]) -> &mut Self
Sourcepub fn remove_structured(&mut self, tag: &[u8]) -> &mut Self
pub fn remove_structured(&mut self, tag: &[u8]) -> &mut Self
Sourcepub fn remove_generic(&mut self, tag: &[u8]) -> &mut Self
pub fn remove_generic(&mut self, tag: &[u8]) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl !Send for Header
impl !Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more