var searchIndex = {}; searchIndex["scan_rules"] = {"doc":"This crate provides some macros for quickly parsing values out of text. Roughly speaking, it does the inverse of the `print!`/`format!` macros; or, in other words, a similar job to `scanf` from C.","items":[[3,"ScanError","scan_rules","Represents an error that occurred during scanning.",null,null],[12,"at","","The rough cursor position at which this error occurred. This will typically be the position the input cursor was at when it began trying to scan a particular literal or value.",0,null],[12,"kind","","The kind of error that occurred.",0,null],[4,"ScanErrorKind","","Indicates the kind of error that occurred during scanning.",null,null],[13,"LiteralMismatch","","Failed to match a literal pattern term.",1,null],[13,"Syntax","","General syntax error.",1,null],[13,"SyntaxNoMessage","","General syntax error.",1,null],[13,"ExpectedEnd","","Expected end-of-input.",1,null],[13,"Float","","Floating point parsing failed.",1,null],[13,"Int","","Integer parsing failed.",1,null],[13,"Io","","An IO error occurred.",1,null],[13,"Other","","Some other error occurred.",1,null],[11,"fmt","","",0,null],[11,"new","","Construct a new `ScanError`.",0,{"inputs":[{"name":"cursor"},{"name":"scanerrorkind"}],"output":{"name":"self"}}],[11,"expected_end","","Shorthand for constructing an `ExpectedEnd` error.",0,{"inputs":[{"name":"cursor"}],"output":{"name":"self"}}],[11,"io","","Shorthand for constructing an `Io` error.",0,{"inputs":[{"name":"error"}],"output":{"name":"self"}}],[11,"literal_mismatch","","Shorthand for constructing a `LiteralMismatch` error.",0,{"inputs":[{"name":"cursor"}],"output":{"name":"self"}}],[11,"syntax","","Shorthand for constructing a `Syntax` error.",0,{"inputs":[{"name":"cursor"},{"name":"str"}],"output":{"name":"self"}}],[11,"other","","Shorthand for constructing an `Other` error.",0,{"inputs":[{"name":"cursor"},{"name":"e"}],"output":{"name":"self"}}],[11,"furthest_along","","Compare two `ScanError`s, and return the one which occurred the furthest into the input cursor.",0,null],[11,"into_static","","Replace the borrowed components of the `ScanError` with `'static` dummy values, allowing the error to escape beyond the lifetime of the original input data.",0,null],[11,"fmt","","",0,null],[11,"cause","","",0,null],[11,"description","","",0,null],[11,"fmt","","",1,null],[11,"from_other","","Construct an `Other` error from some generic error value.",1,{"inputs":[{"name":"e"}],"output":{"name":"self"}}],[11,"fmt","","",1,null],[11,"cause","","",1,null],[11,"description","","",1,null],[0,"input","","This module contains items related to input handling.",null,null],[3,"Cursor","scan_rules::input","The basic input type for scanning.",null,null],[8,"ScanInput","","This trait defines the interface to input values that can be scanned.",null,null],[10,"try_end","","Assert that the input has been exhausted, or that the current position is a valid place to "stop".",2,null],[10,"try_scan","","Scan a value from the current position. The closure will be called with a string slice of all available input, and is expected to return *either* the scanned value, and the number of bytes of input consumed, *or* a reason why scanning failed.",2,null],[10,"try_scan_raw","","Performs the same task as [`try_scan`](#tymethod.try_scan), except that it *does not* perform whitespace stripping.",2,null],[10,"try_match_literal","","Match the provided literal term against the input.",2,null],[11,"hash","","",3,null],[11,"fmt","","",3,null],[11,"eq","","",3,null],[11,"ne","","",3,null],[11,"clone","","",3,null],[11,"new_with_offset","","Construct a new `Cursor` with a specific `offset`.",3,{"inputs":[{"name":"str"},{"name":"usize"}],"output":{"name":"self"}}],[11,"advance_by","","Advance the cursor by the given number of bytes.",3,null],[11,"as_str","","Access the wrapped string slice.",3,null],[11,"offset","","Returns the number of bytes of input that have been consumed by this `Cursor`.",3,null],[11,"deref","","",3,null],[11,"from","","",3,{"inputs":[{"name":"str"}],"output":{"name":"self"}}],[11,"from","","",3,{"inputs":[{"name":"string"}],"output":{"name":"self"}}],[11,"try_end","","",3,null],[11,"try_scan","","",3,null],[11,"try_scan_raw","","",3,null],[11,"try_match_literal","","",3,null],[0,"scanner","scan_rules","This module defines various scanners that can be used to extract values from input text.",null,null],[3,"Everything","scan_rules::scanner","Scans all remaining input into a string.",null,null],[3,"NonSpace","","Scans a sequence of non-space characters into a string.",null,null],[3,"Ident","","Scans a single identifier into a string.",null,null],[3,"Line","","Scans everything up to the end of the current line, *or* the end of the input, whichever comes first. The scanned result *does not* include the line terminator.",null,null],[3,"Number","","Scans a single number into a string.",null,null],[3,"Word","","Scans a single word into a string.",null,null],[3,"Wordish","","Scans a single word-ish thing into a string.",null,null],[3,"KeyValuePair","","An abstract scanner that scans a `(K, V)` value using the syntax `K: V`.",null,null],[3,"Binary","","Scans the given `Output` type from its binary representation.",null,null],[3,"Octal","","Scans the given `Output` type from its octal representation.",null,null],[3,"Hex","","Scans the given `Output` type from its hexadecimal representation.",null,null],[4,"QuotedString","","Scans a quoted string.",null,null],[5,"exact_width","","Creates a runtime scanner that forces *exactly* `width` bytes to be consumed.",null,{"inputs":[{"name":"usize"},{"name":"then"}],"output":{"name":"exactwidth"}}],[5,"exact_width_a","","Creates a runtime scanner that forces *exactly* `width` bytes to be consumed by the static scanner `S`.",null,{"inputs":[{"name":"usize"}],"output":{"name":"exactwidth"}}],[5,"max_width","","Creates a runtime scanner that forces *at most* `width` bytes to be consumed.",null,{"inputs":[{"name":"usize"},{"name":"then"}],"output":{"name":"maxwidth"}}],[5,"max_width_a","","Creates a runtime scanner that forces *at most* `width` bytes to be consumed by the static scanner `S`.",null,{"inputs":[{"name":"usize"}],"output":{"name":"maxwidth"}}],[5,"min_width","","Creates a runtime scanner that forces *at least* `width` bytes to be consumed.",null,{"inputs":[{"name":"usize"},{"name":"then"}],"output":{"name":"minwidth"}}],[5,"min_width_a","","Creates a runtime scanner that forces *at least* `width` bytes to be consumed by the static scanner `S`.",null,{"inputs":[{"name":"usize"}],"output":{"name":"minwidth"}}],[5,"re","","Creates a runtime scanner that extracts a slice of the input using a regular expression, then scans the result using `Then`.",null,{"inputs":[{"name":"str"},{"name":"then"}],"output":{"name":"scanregex"}}],[5,"re_a","","Creates a runtime regex scanner that passes the matched input to a static scanner `S`.",null,{"inputs":[{"name":"str"}],"output":{"name":"scanregex"}}],[5,"re_str","","Creates a runtime regex scanner that yields the matched input as a string slice.",null,{"inputs":[{"name":"str"}],"output":{"name":"scanregex"}}],[5,"scan_a","","Returns a runtime scanner that delegates to a static scanner.",null,{"inputs":[],"output":{"name":"scana"}}],[0,"runtime","","Types and constructors for various runtime scanners.",null,null],[3,"ExactWidth","scan_rules::scanner::runtime","Runtime scanner that forces *exactly* `width` bytes to be consumed.",null,null],[3,"MaxWidth","","Runtime scanner that forces *at most* `width` bytes to be consumed.",null,null],[3,"MinWidth","","Runtime scanner that forces *at least* `width` bytes to be consumed.",null,null],[3,"ScanRegex","","Runtime scanner that slices the input based on a regular expression.",null,null],[3,"ScanA","","Runtime scanner that delegates to a static scanner.",null,null],[5,"exact_width","","Creates a runtime scanner that forces *exactly* `width` bytes to be consumed.",null,{"inputs":[{"name":"usize"},{"name":"then"}],"output":{"name":"exactwidth"}}],[5,"exact_width_a","","Creates a runtime scanner that forces *exactly* `width` bytes to be consumed by the static scanner `S`.",null,{"inputs":[{"name":"usize"}],"output":{"name":"exactwidth"}}],[5,"max_width","","Creates a runtime scanner that forces *at most* `width` bytes to be consumed.",null,{"inputs":[{"name":"usize"},{"name":"then"}],"output":{"name":"maxwidth"}}],[5,"max_width_a","","Creates a runtime scanner that forces *at most* `width` bytes to be consumed by the static scanner `S`.",null,{"inputs":[{"name":"usize"}],"output":{"name":"maxwidth"}}],[5,"min_width","","Creates a runtime scanner that forces *at least* `width` bytes to be consumed.",null,{"inputs":[{"name":"usize"},{"name":"then"}],"output":{"name":"minwidth"}}],[5,"min_width_a","","Creates a runtime scanner that forces *at least* `width` bytes to be consumed by the static scanner `S`.",null,{"inputs":[{"name":"usize"}],"output":{"name":"minwidth"}}],[5,"re","","Creates a runtime scanner that extracts a slice of the input using a regular expression, then scans the result using `Then`.",null,{"inputs":[{"name":"str"},{"name":"then"}],"output":{"name":"scanregex"}}],[5,"re_a","","Creates a runtime regex scanner that passes the matched input to a static scanner `S`.",null,{"inputs":[{"name":"str"}],"output":{"name":"scanregex"}}],[5,"re_str","","Creates a runtime regex scanner that yields the matched input as a string slice.",null,{"inputs":[{"name":"str"}],"output":{"name":"scanregex"}}],[5,"scan_a","","Returns a runtime scanner that delegates to a static scanner.",null,{"inputs":[],"output":{"name":"scana"}}],[11,"scan","","",4,null],[11,"scan","","",5,null],[11,"scan","","",6,null],[11,"scan","","",7,null],[11,"scan","","",8,null],[0,"util","scan_rules::scanner","Internal utilities for scanner implementations.",null,null],[4,"EscapeError","scan_rules::scanner::util","Indicates why unescaping a character from a string failed.",null,null],[13,"LoneSlash","","Backslash with nothing after it.",9,null],[13,"UnknownEscape","","Backslash followed by unrecognised character.",9,null],[13,"MalformedHex","","Malformed hex escape sequence.",9,null],[13,"MalformedUnicode","","Malformed unicode escape sequence.",9,null],[13,"InvalidValue","","Escape contained an invalid value.",9,null],[8,"StrUtil","","Various string utility methods.",null,null],[10,"subslice_offset","","Returns the byte offset of an inner slice relative to an enclosing outer slice.",10,null],[10,"split_escape_default","","Extracts an escape sequence (sans leading backslash) from the start of this string, returning the unescaped code point, and the unconsumed input.",10,null],[11,"fmt","","",9,null],[11,"eq","","",9,null],[11,"ne","","",9,null],[11,"clone","","",9,null],[11,"fmt","","",9,null],[11,"description","","",9,null],[11,"scan_from","scan_rules::scanner","",11,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",12,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",13,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",14,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",15,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",16,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",17,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",18,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",19,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",20,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",21,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[11,"scan_from","","",22,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[8,"ScanFromStr","","This trait defines the interface to a type which can be scanned.",null,null],[16,"Output","","The type that the implementation scans into. This *does not* have to be the same as the implementing type, although it typically *will* be.",23,null],[10,"scan_from","","Perform a scan on the given input.",23,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[8,"ScanSelfFromStr","","This is a convenience trait automatically implemented for all scanners which result in themselves (*i.e.* `ScanFromStr::Output = Self`).",null,null],[11,"scan_self_from","","Perform a scan on the given input.",24,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[8,"ScanFromBinary","","This trait defines scanning a type from a binary representation.",null,null],[10,"scan_from_binary","","Perform a scan on the given input.",25,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[8,"ScanFromOctal","","This trait defines scanning a type from an octal representation.",null,null],[10,"scan_from_octal","","Perform a scan on the given input.",26,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[8,"ScanFromHex","","This trait defines scanning a type from a hexadecimal representation.",null,null],[10,"scan_from_hex","","Perform a scan on the given input.",27,{"inputs":[{"name":"str"}],"output":{"name":"result"}}],[8,"ScanStr","","This trait defines the interface for runtime scanners.",null,null],[16,"Output","","The type that the implementation scans into.",28,null],[10,"scan","","Perform a scan on the given input.",28,null],[14,"readln!","scan_rules","Reads a line of text from standard input, then scans it using the provided rules. The result of the `readln!` invocation is the type of the rule bodies; just as with `match`, all bodies must agree on their result type.",null,null],[14,"try_readln!","","Reads a line of text from standard input, then scans it using the provided rules. The result of the `try_readln!` invocation is a `Result<T, ScanError>`, where `T` is the type of the rule bodies; just as with `match`, all bodies must agree on their result type.",null,null],[14,"let_scan!","","Scans the provided input, using the specified pattern. All values are bound directly to local variables.",null,null],[14,"scan!","","Scans the provided input, using the specified rules. The result is a `Result<T, ScanError>` where `T` is the type of the rule bodies; just as with `match`, all bodies must agree on their result type.",null,null]],"paths":[[3,"ScanError"],[4,"ScanErrorKind"],[8,"ScanInput"],[3,"Cursor"],[3,"ExactWidth"],[3,"MaxWidth"],[3,"MinWidth"],[3,"ScanRegex"],[3,"ScanA"],[4,"EscapeError"],[8,"StrUtil"],[3,"Binary"],[3,"Everything"],[3,"Hex"],[3,"Ident"],[3,"Line"],[3,"NonSpace"],[3,"Number"],[3,"Octal"],[3,"KeyValuePair"],[4,"QuotedString"],[3,"Word"],[3,"Wordish"],[8,"ScanFromStr"],[8,"ScanSelfFromStr"],[8,"ScanFromBinary"],[8,"ScanFromOctal"],[8,"ScanFromHex"],[8,"ScanStr"]]}; initSearch(searchIndex);