Module structs

Module structs 

Source
Expand description

Structures that implement different methods on Parser trait

Structsยง

DisplayWith ๐Ÿ”’
An implementation detail for ParseFallback::format_fallback and ParseFallbackWith::format_fallback, to allow for custom fallback formatting.
ParseAdjacent
ParseCollect
Apply inner parser several times and collect results into FromIterator, created with collect, Implements catch
ParseCon
Create parser from a function, construct! uses it internally
ParseCount
Apply inner parser as many times as it succeeds while consuming something and return this number
ParseFail
Parser that fails without consuming any input, created with fail.
ParseFallback
Parser that substitutes missing value but not parse failure, created with fallback.
ParseFallbackWith
Parser that substitutes missing value with a function results but not parser failure, created with fallback_with.
ParseGroupHelp
Parser with attached message to several fields, created with group_help.
ParseGuard
Parser fails with a message if check returns false, created with guard.
ParseHide
Parser that returns results as usual but not shown in --help output, created with Parser::hide
ParseLast
Apply inner parser as many times as it succeeds while consuming something and return this number
ParseMany
Apply inner parser several times and collect results into Vec, created with many, implements catch.
ParseMap
Parser that transforms parsed value with a function, created with map.
ParseOptional
Apply inner parser, return a value in Some if items requested by it are all present, restore and return None if any are missing. Created with optional. Implements catch
ParseOrElse
Parser that tries to either of two parsers and uses one that succeeeds, created with Parser::or_else.
ParsePure
Parser that returns a given value without consuming anything, created with pure.
ParsePureWith
ParseSome
Apply inner parser several times and collect results into Vec, created with some, requires for at least one item to be available to succeed. Implements catch
ParseUsage
Parser that hides inner parser from usage line
ParseWith
Parser that transforms parsed value with a failing function, created with parse
ParseWithGroupHelp
Parser with attached message to several fields, created with group_help.

Functionsยง

parse_option ๐Ÿ”’
try to parse
this_or_that_picks_first ๐Ÿ”’
Given two possible errors along with to sets of arguments produce a new error or an instruction to pick between two answers. Updates arguments state to match the results