Skip to main content

parse_optional_value

Function parse_optional_value 

Source
fn parse_optional_value<'a, O, P: Parser<Input<'a>, O, ErrMode<ParseStack<'a>>>>(
    keyword: &Keyword,
    value: &'a Value,
    parser: P,
) -> Result<Option<O>, BridgeError>
Expand description

Ensures a combination of Keyword and Value uses a Value::Single and parses the value as a specific, but optional type.

Returns None if value is empty.

ยงErrors

Returns a error for keyword if value is not Value::Single or cannot be parsed as the specific type.