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],[3,"ScanErrorAt","","Represents the position at which an error occurred.",null,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":"usize"},{"name":"scanerrorkind"}],"output":{"name":"self"}}],[11,"expected_end","","Shorthand for constructing an `ExpectedEnd` error.",0,{"inputs":[],"output":{"name":"self"}}],[11,"float","","Shorthand for constructing an `Float` error.",0,{"inputs":[{"name":"parsefloaterror"}],"output":{"name":"self"}}],[11,"int","","Shorthand for constructing an `Int` error.",0,{"inputs":[{"name":"parseinterror"}],"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":[],"output":{"name":"self"}}],[11,"syntax","","Shorthand for constructing a `Syntax` error.",0,{"inputs":[{"name":"str"}],"output":{"name":"self"}}],[11,"syntax_no_message","","Shorthand for constructing a `SyntaxNoMessage` error.",0,{"inputs":[],"output":{"name":"self"}}],[11,"other","","Shorthand for constructing an `Other` error.",0,{"inputs":[{"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,"add_offset","","Adds the given number of `bytes` to the error's position.",0,null],[11,"fmt","","",0,null],[11,"cause","","",0,null],[11,"description","","",0,null],[11,"fmt","","",2,null],[11,"offset","","Return the offset from the start of input that an error occurred at, in bytes.",2,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,"StrCursor","scan_rules::input","Basic cursor implementation wrapping a string slice.",null,null],[4,"IgnoreSpace","","Ignores all whitespace entirely.",null,null],[4,"Wordish","","Treat any contiguous sequence of "word" characters (according to Unicode's definition of the `\\w` regular expression class) *or* any other single character as a word.",null,null],[4,"ExactCompare","","Marker type used to do exact, byte-for-byte string comparisons.",null,null],[4,"IgnoreAsciiCase","","Marker type used to do ASCII case-insensitive string comparisons.",null,null],[8,"IntoScanCursor","","Conversion into a `ScanCursor`.",null,null],[16,"Output","","The corresponding scannable cursor type.",3,null],[10,"into_scan_cursor","","Convert this into a scannable cursor.",3,null],[8,"ScanCursor","","This trait defines the interface to input values that can be scanned.",null,null],[16,"ScanInput","","Corresponding scan input type.",4,null],[10,"try_end","","Assert that the input has been exhausted, or that the current position is a valid place to "stop".",4,null],[10,"try_scan","","Scan a value from the current position. The closure will be called with 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.",4,null],[10,"try_scan_raw","","Performs the same task as [`try_scan`](#tymethod.try_scan), except that it *does not* perform whitespace stripping.",4,null],[10,"try_match_literal","","Match the provided literal term against the input.",4,null],[10,"as_str","","Returns the remaining input as a string slice.",4,null],[10,"offset","","Returns the number of bytes consumed by this cursor since its creation.",4,null],[8,"ScanInput","","This trait is the interface scanners use to access the input being scanned.",null,null],[16,"ScanCursor","","Corresponding cursor type.",5,null],[16,"StrCompare","","Marker type used to do string comparisons.",5,null],[10,"as_str","","Get the contents of the input as a string slice.",5,null],[10,"from_subslice","","Create a new input from a subslice of *this* input's contents.",5,null],[10,"to_cursor","","Turn the input into an independent cursor, suitable for feeding back into a user-facing scanning macro.",5,null],[8,"SkipSpace","","Defines an interface for skipping whitespace.",null,null],[10,"match_spaces","","Given two strings, does the leading whitespace match?",6,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"name":"result"}}],[10,"skip_space","","Return the number of bytes of leading whitespace in `a` that should be skipped.",6,{"inputs":[{"name":"str"}],"output":{"name":"usize"}}],[8,"SliceWord","","Defines an interface for slicing words out of input and literal text.",null,null],[10,"slice_word","","If `s` starts with a word, how long is it?",7,{"inputs":[{"name":"str"}],"output":{"name":"option"}}],[8,"StrCompare","","Defines an interface for comparing two strings for equality.",null,null],[10,"compare","","Compare two strings and return `true` if they should be considered "equal".",8,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"name":"bool"}}],[11,"fmt","","",9,null],[11,"clone","","",9,null],[11,"new","","Construct a new `StrCursor` with a specific `offset`.",9,{"inputs":[{"name":"str"}],"output":{"name":"self"}}],[11,"try_end","","",9,null],[11,"try_scan","","",9,null],[11,"try_scan_raw","","",9,null],[11,"try_match_literal","","",9,null],[11,"as_str","","",9,null],[11,"offset","","",9,null],[11,"as_str","","",9,null],[11,"from_subslice","","",9,null],[11,"to_cursor","","",9,null],[11,"fmt","","",10,null],[11,"match_spaces","","",10,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"name":"result"}}],[11,"skip_space","","",10,{"inputs":[{"name":"str"}],"output":{"name":"usize"}}],[11,"fmt","","",11,null],[11,"slice_word","","",11,{"inputs":[{"name":"str"}],"output":{"name":"option"}}],[11,"fmt","","",12,null],[11,"compare","","",12,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"name":"bool"}}],[11,"fmt","","",13,null],[11,"compare","","",13,{"inputs":[{"name":"str"},{"name":"str"}],"output":{"name":"bool"}}],[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,"Space","","Scans a sequence of 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,"Inferred","","Explicitly infer the type of a scanner.",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,"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,"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,"scan_a","","Returns a runtime scanner that delegates to a static scanner.",null,{"inputs":[],"output":{"name":"scana"}}],[11,"scan","","",14,null],[11,"wants_leading_junk_stripped","","",14,null],[11,"scan","","",15,null],[11,"wants_leading_junk_stripped","","",15,null],[11,"scan","","",16,null],[11,"wants_leading_junk_stripped","","",16,null],[11,"scan","","",17,null],[11,"wants_leading_junk_stripped","","",17,null],[11,"scan_from","scan_rules::scanner","",18,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",19,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",20,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",21,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",22,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",23,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",24,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",25,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",26,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",27,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",28,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",29,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"wants_leading_junk_stripped","","",29,{"inputs":[],"output":{"name":"bool"}}],[11,"scan_from","","",30,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"scan_from","","",31,{"inputs":[{"name":"i"}],"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.",32,null],[10,"scan_from","","Perform a scan on the given input.",32,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[11,"wants_leading_junk_stripped","","Indicates whether or not the scanner wants its input to have leading "junk", such as whitespace, stripped.",32,{"inputs":[],"output":{"name":"bool"}}],[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.",33,{"inputs":[{"name":"i"}],"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.",34,{"inputs":[{"name":"i"}],"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.",35,{"inputs":[{"name":"i"}],"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.",36,{"inputs":[{"name":"i"}],"output":{"name":"result"}}],[8,"ScanStr","","This trait defines the interface for runtime scanners.",null,null],[16,"Output","","The type that the implementation scans into.",37,null],[10,"scan","","Perform a scan on the given input.",37,null],[10,"wants_leading_junk_stripped","","Indicates whether or not the scanner wants its input to have leading "junk", such as whitespace, stripped.",37,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"],[3,"ScanErrorAt"],[8,"IntoScanCursor"],[8,"ScanCursor"],[8,"ScanInput"],[8,"SkipSpace"],[8,"SliceWord"],[8,"StrCompare"],[3,"StrCursor"],[4,"IgnoreSpace"],[4,"Wordish"],[4,"ExactCompare"],[4,"IgnoreAsciiCase"],[3,"ExactWidth"],[3,"MaxWidth"],[3,"MinWidth"],[3,"ScanA"],[3,"Binary"],[3,"Everything"],[3,"Hex"],[3,"Ident"],[3,"Inferred"],[3,"Line"],[3,"NonSpace"],[3,"Number"],[3,"Octal"],[3,"KeyValuePair"],[4,"QuotedString"],[3,"Space"],[3,"Word"],[3,"Wordish"],[8,"ScanFromStr"],[8,"ScanSelfFromStr"],[8,"ScanFromBinary"],[8,"ScanFromOctal"],[8,"ScanFromHex"],[8,"ScanStr"]]}; initSearch(searchIndex);