pub fn from_str_key(s: &str, key: &Key) -> Result<Self, ParseError> {
        match key.ty() {
            Type::Integer => match key.number() {
                Number::Count(0) => Err(ParseError::InvalidNumberForType(key.number(), key.ty())),
                Number::Count(1) => parse_i32(s),
                _ => parse_i32_array(s),
            },
            Type::Float => match key.number() {
                Number::Count(0) => Err(ParseError::InvalidNumberForType(key.number(), key.ty())),
                Number::Count(1) => parse_f32(s),
                _ => parse_f32_array(s),
            },
            Type::Character => match key.number() {
                Number::Count(0) => Err(ParseError::InvalidNumberForType(key.number(), key.ty())),
                Number::Count(1) => parse_char(s),
                _ => parse_char_array(s),
            },
            Type::String => match key.number() {
                Number::Count(0) => Err(ParseError::InvalidNumberForType(key.number(), key.ty())),
                Number::Count(1) => parse_string(s),
                _ => parse_string_array(s),
            },
        }
    }
/// Parses a raw genotype field value for the given key.
///
/// # Examples
///
/// ```
/// use noodles_vcf::record::genotypes::genotype::field::{Key, Value};
///
/// assert_eq!(
///     Value::from_str_key("13", &Key::ConditionalGenotypeQuality),
///     Ok(Value::Integer(13))
/// );
/// ```
Parses a raw genotype field value for the given key.
Parses a raw genotype field value for the given key .
pub fn from_str_key(s: &str, key: &Key) -> Result<Self, ParseError> {
        match key.ty() {
            Type::Integer => match key.number() {
                Number::Count(0) => Err(ParseError::InvalidNumberForType(key.number(), key.ty())),
                Number::Count(1) => parse_i32(s),
                _ => parse_i32_array(s),
            },
            Type::Float => match key.number() {
                Number::Count(0) => Err(ParseError::InvalidNumberForType(key.number(), key.ty())),
                Number::Count(1) => parse_f32(s),
                _ => parse_f32_array(s),
            },
            Type::Character => match key.number() {
                Number::Count(0) => Err(ParseError::InvalidNumberForType(key.number(), key.ty())),
                Number::Count(1) => parse_char(s),
                _ => parse_char_array(s),
            },
            Type::String => match key.number() {
                Number::Count(0) => Err(ParseError::InvalidNumberForType(key.number(), key.ty())),
                Number::Count(1) => parse_string(s),
                _ => parse_string_array(s),
            },
        }
    }
pub fn from_str_key ( s : & str , key : & Key ) -> Result < Self , ParseError > { match key . ty ( ) { Type :: Integer => match key . number ( ) { Number :: Count ( 0 ) => Err ( ParseError :: InvalidNumberForType ( key . number ( ) , key . ty ( ) ) ) , Number :: Count ( 1 ) => parse_i32 ( s ) , _ => parse_i32_array ( s ) , } , Type :: Float => match key . number ( ) { Number :: Count ( 0 ) => Err ( ParseError :: InvalidNumberForType ( key . number ( ) , key . ty ( ) ) ) , Number :: Count ( 1 ) => parse_f32 ( s ) , _ => parse_f32_array ( s ) , } , Type :: Character => match key . number ( ) { Number :: Count ( 0 ) => Err ( ParseError :: InvalidNumberForType ( key . number ( ) , key . ty ( ) ) ) , Number :: Count ( 1 ) => parse_char ( s ) , _ => parse_char_array ( s ) , } , Type :: String => match key . number ( ) { Number :: Count ( 0 ) => Err ( ParseError :: InvalidNumberForType ( key . number ( ) , key . ty ( ) ) ) , Number :: Count ( 1 ) => parse_string ( s ) , _ => parse_string_array ( s ) , } , } }
Parses a raw genotype field value for the given key.
Parses a raw genotype field value for the given key .
s
&str
key
&Key
s
&str
key
&Key
examples
```
use noodles_vcf::record::genotypes::genotype::field::{Key, Value}.

assert_eq!(
Value::from_str_key("13", &Key::ConditionalGenotypeQuality),
Ok(Value::Integer(13))
);
```
` ` ` use noodles_vcf :: record :: genotypes :: genotype :: field :: { Key Value } . assert_eq! ( Value :: from_str_key ( " 13 " &Key :: ConditionalGenotypeQuality ) Ok ( Value :: Integer ( 13 )) ) ; ` ` `