Struct semver_parser::parser::Parser[][src]

pub struct Parser<'input> { /* fields omitted */ }

A recursive-descent parser for parsing version requirements.

Methods

impl<'input> Parser<'input>
[src]

Construct a new parser for the given input.

Parse an optional comma separator, then if that is present a predicate.

Parse a single component.

Returns None if the component is a wildcard.

Parse a single numeric.

Optionally parse a dot, then a component.

The second component of the tuple indicates if a wildcard has been encountered, and is always false if the first component is Some.

If a dot is not encountered, (None, false) is returned.

If a wildcard is encountered, (None, true) is returned.

Parse a dot, then a numeric.

Parse an string identifier.

Like, foo, or bar.

Optionally parse a single operator.

Like, ~, or ^.

Parse a single predicate.

Like, ^1, or >=2.0.0.

Parse a single range.

Like, ^1.0 or >=3.0.0, <4.0.0.

Parse a comparator.

Like, 1.0 || 2.0 or ^1 || >=3.0.0, <4.0.0.

Parse a version.

Like, 1.0.0 or 3.0.0-beta.1.

Check if we have reached the end of input.

Get the rest of the tokens in the parser.

Useful for debugging.

Auto Trait Implementations

impl<'input> Send for Parser<'input>

impl<'input> Sync for Parser<'input>