Struct piston_meta::Search
[−]
[src]
pub struct Search<'a> { pub range: Option<Range>, pub data: &'a [(Range, MetaData)], }
Used to search through meta data.
Fields
range: Option<Range>
The previous range of search. Used in errors if there is no meta data left.
data: &'a [(Range, MetaData)]
The data to search.
Methods
impl<'a> Search<'a>
[src]
fn new(data: &'a [(Range, MetaData)]) -> Search<'a>
Creates a new search.
fn for_string<T, F>(&'a self, name: &str, val: &str, f: F) -> Result<T, (Range, ParseError)> where F: FnOnce(Search<'a>) -> Result<T, (Range, ParseError)>
Searches anywhere in meta data for a string. Calls closure on the first match.
fn f64(&mut self, name: &str) -> Result<f64, (Range, ParseError)>
Reads next as f64 value.