Struct uap_rust::parser::Parser
[−]
[src]
pub struct Parser {
pub ua_regex: Vec<UserAgentParser>,
pub devices_regex: Vec<DeviceParser>,
pub os_regex: Vec<OSParser>,
}The Parser type, used for parsing user agent strings into Client structs.
Fields
ua_regex | |
devices_regex | |
os_regex |
Methods
impl Parser
fn from_file(regexes_file: &str) -> Result<Parser>
Constructs a Parser from a file path to a regexes file.
See uap-core documentation for information on the file format.
fn from_str(s: &str) -> Result<Parser>
Constructs a Parser from an str containing regexes.
See uap-core documentation for information on the format.
fn new() -> Result<Parser>
Constructs a Parser from the staticly complied regexes file data.
See uap-core documentation for information on the format.
fn parse(&self, agent: String) -> Client
Parses a user agent string into a Client struct.