pub fn from_sam(header_view: &HeaderView, sam: &[u8]) -> Result<Record, ReadError> {
        let record = Self::new();

        let mut sam_copy = Vec::with_capacity(sam.len() + 1);
        sam_copy.extend(sam);
        sam_copy.push(0);

        let mut sam_string = htslib::kstring_t {
            s: sam_copy.as_ptr() as *mut i8,
            l: sam_copy.len() as usize,
            m: sam_copy.len() as usize,
        };

        let succ = unsafe {
            htslib::sam_parse1(&mut sam_string, header_view.inner_ptr_mut(), record.inner)
        };

        if succ == 0 {
            Ok(record)
        } else {
            Err(ReadError::Invalid)
        }
    }
// Create a BAM record from a line SAM text. SAM slice need not be 0-terminated.
Create a BAM record from a line SAM text. SAM slice need not be 0-terminated.
Create a BAM record from a line SAM text . SAM slice need not be 0 - terminated .
pub fn from_sam(header_view: &HeaderView, sam: &[u8]) -> Result<Record, ReadError> {
        let record = Self::new();
        let mut sam_copy = Vec::with_capacity(sam.len() + 1);
        sam_copy.extend(sam);
        sam_copy.push(0);
        let mut sam_string = htslib::kstring_t {
            s: sam_copy.as_ptr() as *mut i8,
            l: sam_copy.len() as usize,
            m: sam_copy.len() as usize,
        };
        let succ = unsafe {
            htslib::sam_parse1(&mut sam_string, header_view.inner_ptr_mut(), record.inner)
        };
        if succ == 0 {
            Ok(record)
        } else {
            Err(ReadError::Invalid)
        }
    }
pub fn from_sam ( header_view : & HeaderView , sam : & [ u8 ] ) -> Result < Record , ReadError > { let record = Self :: new ( ) ; let mut sam_copy = Vec :: with_capacity ( sam . len ( ) + 1 ) ; sam_copy . extend ( sam ) ; sam_copy . push ( 0 ) ; let mut sam_string = htslib :: kstring_t { s : sam_copy . as_ptr ( ) as * mut i8 , l : sam_copy . len ( ) as usize , m : sam_copy . len ( ) as usize , } ; let succ = unsafe { htslib :: sam_parse1 ( & mut sam_string , header_view . inner_ptr_mut ( ) , record . inner ) } ; if succ == 0 { Ok ( record ) } else { Err ( ReadError :: Invalid ) } }
Create a BAM record from a line SAM text.
Create a BAM record from a line SAM text .
header_view
&HeaderView
sam
&[u8]
header_view
&HeaderView
sam
&[u8]