pub fn optional<O: 'static>(p: impl Into<Parser<O>>) -> Parser<Option<O>>
Expand description

Tries to apply the parser. Outputs an Option with None if it failed to apply the parser and no input was consumed, and Some if it succeeded. Outputs an error if some but not all input was consumed.