Struct rusqbin::models::IdExtractor [] [src]

pub struct IdExtractor(_);

Parses normal Strings into an Id according to the compiled Regex that it holds.

Exists purely because we can't have Regexp constants in Rust (yet).

For usage, see docs for Id.

Methods

impl IdExtractor
[src]

Returns a new Id extractor

use rusqbin::models::*;

let id_extractor = IdExtractor::new();
assert!(id_extractor.parse("hello").is_none()); // does not fit our id patternRun

Parses a string into an Id if it is of the right format.