noodles_csi::binning_index::index::header

Struct Header

Source
pub struct Header { /* private fields */ }
Expand description

A tabix index header.

Implementations§

Source§

impl Header

Source

pub fn builder() -> Builder

Creates a tabix index header builder.

§Examples
use noodles_csi::binning_index::index::Header;
let builder = Header::builder();
Source

pub fn format(&self) -> Format

Returns the format.

§Examples
use noodles_csi::binning_index::index::{header::Format, Header};
let header = Header::builder().set_format(Format::Vcf).build();
assert_eq!(header.format(), Format::Vcf);
Source

pub fn reference_sequence_name_index(&self) -> usize

Returns the reference sequence name field index.

This index is 0-based.

§Examples
use noodles_csi::binning_index::index::Header;
let header = Header::builder().set_reference_sequence_name_index(0).build();
assert_eq!(header.reference_sequence_name_index(), 0);
Source

pub fn start_position_index(&self) -> usize

Returns the start position field index.

This index is 0-based.

§Examples
use noodles_csi::binning_index::index::Header;
let header = Header::builder().set_start_position_index(3).build();
assert_eq!(header.start_position_index(), 3);
Source

pub fn end_position_index(&self) -> Option<usize>

Returns the end position field index.

This index is 0-based. It is not set if the format does not have a column for the end position.

§Examples
use noodles_csi::binning_index::index::Header;
let header = Header::builder().set_end_position_index(Some(5)).build();
assert_eq!(header.end_position_index(), Some(5));
Source

pub fn line_comment_prefix(&self) -> u8

Returns the line comment prefix.

§Examples
use noodles_csi::binning_index::index::Header;
let header = Header::builder().set_line_comment_prefix(b'#').build();
assert_eq!(header.line_comment_prefix(), b'#');
Source

pub fn line_skip_count(&self) -> u32

Returns the number of lines to skip.

§Examples
use noodles_csi::binning_index::index::Header;
let header = Header::builder().set_line_skip_count(0).build();
assert_eq!(header.line_skip_count(), 0);
Source

pub fn reference_sequence_names(&self) -> &ReferenceSequenceNames

Returns the reference sequence names.

§Examples
use noodles_csi::binning_index::index::{header::ReferenceSequenceNames, Header};

let reference_sequence_names = ReferenceSequenceNames::new();

let header = Header::builder()
    .set_reference_sequence_names(reference_sequence_names.clone())
    .build();

assert_eq!(header.reference_sequence_names(), &reference_sequence_names);
Source

pub fn reference_sequence_names_mut(&mut self) -> &mut ReferenceSequenceNames

Returns a mutable reference to the reference sequence names.

§Examples
use noodles_csi::binning_index::index::{header::ReferenceSequenceNames, Header};

let reference_sequence_names = ReferenceSequenceNames::new();

let mut header = Header::default();
*header.reference_sequence_names_mut() = reference_sequence_names.clone();

assert_eq!(header.reference_sequence_names(), &reference_sequence_names);

Trait Implementations§

Source§

impl Clone for Header

Source§

fn clone(&self) -> Header

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Header

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Header

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl PartialEq for Header

Source§

fn eq(&self, other: &Header) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for Header

Source§

impl StructuralPartialEq for Header

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.