rust_htslib::bcf::record

Struct Format

Source
pub struct Format<'a, B: BorrowMut<Buffer> + Borrow<Buffer>> { /* private fields */ }

Implementations§

Source§

impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Format<'a, B>

Source

pub fn desc(&self) -> String

Provide short description of format entry (just the tag name).

Source

pub fn inner(&self) -> &bcf_fmt_t

Source

pub fn inner_mut(&mut self) -> &mut bcf_fmt_t

Source

pub fn integer(self) -> Result<BufferBacked<'b, Vec<&'b [i32]>, B>>

Get format data as integers.

Attention: the returned BufferBacked which holds the data has to be kept in scope as long as the data is accessed. If parts of the data are accessed while the BufferBacked object is already dropped, you will access unallocated memory.

Source

pub fn float(self) -> Result<BufferBacked<'b, Vec<&'b [f32]>, B>>

Get format data as floats.

Attention: the returned BufferBacked which holds the data has to be kept in scope as along as the data is accessed. If parts of the data are accessed while the BufferBacked object is already dropped, you will access unallocated memory.

Source

pub fn string(self) -> Result<BufferBacked<'b, Vec<&'b [u8]>, B>>

Get format data as byte slices. To obtain the values strings, use std::str::from_utf8.

Attention: the returned BufferBacked which holds the data has to be kept in scope as along as the data is accessed. If parts of the data are accessed while the BufferBacked object is already dropped, you will access unallocated memory.

Trait Implementations§

Source§

impl<'a, B: Debug + BorrowMut<Buffer> + Borrow<Buffer>> Debug for Format<'a, B>

Source§

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

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

impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Send for Format<'a, B>

Source§

impl<'a, 'b, B: BorrowMut<Buffer> + Borrow<Buffer> + 'b> Sync for Format<'a, B>

Auto Trait Implementations§

§

impl<'a, B> Freeze for Format<'a, B>
where B: Freeze,

§

impl<'a, B> RefUnwindSafe for Format<'a, B>
where B: RefUnwindSafe,

§

impl<'a, B> Unpin for Format<'a, B>
where B: Unpin,

§

impl<'a, B> UnwindSafe for Format<'a, B>
where B: UnwindSafe,

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> 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, 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.
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T