/// Convert string sample name to its numeric identifier.
Convert string sample name to its numeric identifier.
Convert string sample name to its numeric identifier .
pub fn sample_to_id(&self, id: &[u8]) -> Result<Id, SampleError> {
        unsafe {
            match htslib::bcf_hdr_id2int(
                self.inner,
                htslib::BCF_DT_SAMPLE as i32,
                ffi::CString::new(id).unwrap().as_ptr() as *const i8,
            ) {
                -1 => Err(SampleError::UnknownSample(
                    str::from_utf8(id).unwrap().to_owned(),
                )),
                i => Ok(Id(i as u32)),
            }
        }
    }
pub fn sample_to_id ( & self , id : & [ u8 ] ) -> Result < Id , SampleError > { unsafe { match htslib :: bcf_hdr_id2int ( self . inner , htslib :: BCF_DT_SAMPLE as i32 , ffi :: CString :: new ( id ) . unwrap ( ) . as_ptr ( ) as * const i8 , ) { - 1 => Err ( SampleError :: UnknownSample ( str :: from_utf8 ( id ) . unwrap ( ) . to_owned ( ) , ) ) , i => Ok ( Id ( i as u32 ) ) , } } }
Convert string sample name to its numeric identifier.
Convert string sample name to its numeric identifier .
&self
id
&[u8]