Struct semver_parser::parser::Parser [−][src]
A recursive-descent parser for parsing version requirements.
Implementations
impl<'input> Parser<'input>
[src]
pub fn new(input: &'input str) -> Result<Parser<'input>, Error<'input>>
[src]
Construct a new parser for the given input.
pub fn component(&mut self) -> Result<Option<u64>, Error<'input>>
[src]
Parse a single component.
Returns None
if the component is a wildcard.
pub fn numeric(&mut self) -> Result<u64, Error<'input>>
[src]
Parse a single numeric.
pub fn dot_component(&mut self) -> Result<(Option<u64>, bool), Error<'input>>
[src]
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.
pub fn dot_numeric(&mut self) -> Result<u64, Error<'input>>
[src]
Parse a dot, then a numeric.
pub fn identifier(&mut self) -> Result<Identifier, Error<'input>>
[src]
Parse an string identifier.
Like, foo
, or bar
, or beta-1
.
pub fn version(&mut self) -> Result<Version, Error<'input>>
[src]
Parse a version.
Like, 1.0.0
or 3.0.0-beta.1
.
pub fn is_eof(&mut self) -> bool
[src]
Check if we have reached the end of input.
pub fn tail(&mut self) -> Result<Vec<Token<'input>>, Error<'input>>
[src]
Get the rest of the tokens in the parser.
Useful for debugging.
Auto Trait Implementations
impl<'input> RefUnwindSafe for Parser<'input>
impl<'input> Send for Parser<'input>
impl<'input> Sync for Parser<'input>
impl<'input> Unpin for Parser<'input>
impl<'input> UnwindSafe for Parser<'input>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,