parse_iter

Function parse_iter 

Source
pub fn parse_iter<'i, Ctx: Clone>(
    iter: impl Iterator<Item = (Cow<'i, str>, Option<Cow<'i, str>>, Ctx)>,
) -> Vec<(ParseWarning, Ctx)>
Expand description

Parse and activate experimental options.

This is the recommended way to activate options, as it handles ParseWarnings properly and is easy to hook into.

When the key "all" is encountered, set_all is used to set all experimental options that aren’t deprecated. This allows opting (or opting out of) all experimental options that are currently available for testing.

The iter argument should yield:

  • the identifier of the option
  • an optional assignment value (true/false)
  • a context value, which is returned with any warning

This way you don’t need to manually track which input caused which warning.