/// Convert string ID (e.g., for a `FILTER` value) to its numeric identifier.
Convert string ID  to its numeric identifier.
Convert string ID to its numeric identifier .
pub fn name_to_id(&self, id: &[u8]) -> Result<Id, IdError> {
        unsafe {
            match htslib::bcf_hdr_id2int(
                self.inner,
                htslib::BCF_DT_ID as i32,
                ffi::CString::new(id).unwrap().as_ptr() as *const i8,
            ) {
                -1 => Err(IdError::UnknownID(str::from_utf8(id).unwrap().to_owned())),
                i => Ok(Id(i as u32)),
            }
        }
    }
pub fn name_to_id ( & self , id : & [ u8 ] ) -> Result < Id , IdError > { unsafe { match htslib :: bcf_hdr_id2int ( self . inner , htslib :: BCF_DT_ID as i32 , ffi :: CString :: new ( id ) . unwrap ( ) . as_ptr ( ) as * const i8 , ) { - 1 => Err ( IdError :: UnknownID ( str :: from_utf8 ( id ) . unwrap ( ) . to_owned ( ) ) ) , i => Ok ( Id ( i as u32 ) ) , } } }
Convert string ID (e.g., for a `FILTER` value) to its numeric identifier.
Convert string ID ( e . g . for a ` FILTER ` value ) to its numeric identifier .
&self
id
&[u8]