[][src]Trait bam::record::tags::WriteValue

pub trait WriteValue: Sealed {
    fn write<W: Write>(&self, f: &mut W) -> Result<usize>;
}

A trait for writing tag values. Implemented for:

  • char, but will return error, if char takes more than one byte,
  • numeric values i8, u8, i16, u16, i32, u32, f32,
  • numeric slices &[i8], &[u8], &[i16], ..., &[f32],
  • string slice &str. You can use std::str::from_utf8_unchecked to convert &[u8] to &str. We use &str here to distinguish between string and int array types.
  • hex wrapper over &[u8],

String and Hex values cannot contain null symbols, even at the end.

The trait cannot be implemented for new types.

Required methods

fn write<W: Write>(&self, f: &mut W) -> Result<usize>

Returns the number of written bytes (does not include name).

Loading content...

Implementations on Foreign Types

impl WriteValue for char[src]

impl WriteValue for i8[src]

impl WriteValue for u8[src]

impl WriteValue for i16[src]

impl WriteValue for u16[src]

impl WriteValue for i32[src]

impl WriteValue for u32[src]

impl WriteValue for f32[src]

impl<'_> WriteValue for &'_ str[src]

impl<'_> WriteValue for &'_ [i8][src]

impl<'_> WriteValue for &'_ [u8][src]

impl<'_> WriteValue for &'_ [i16][src]

impl<'_> WriteValue for &'_ [u16][src]

impl<'_> WriteValue for &'_ [i32][src]

impl<'_> WriteValue for &'_ [u32][src]

impl<'_> WriteValue for &'_ [f32][src]

Loading content...

Implementors

impl<'a> WriteValue for Hex<'a>[src]

Loading content...