lest 0.2.1

A modular approach to a web server. Based on actix-web.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::models::ua::UserAgent;

pub fn parse_user_agent(user_agent: String) -> UserAgent {
    let user = woothee::parser::Parser::new();
    let result = user.parse(&user_agent).unwrap();
    UserAgent {
        name: Some(result.name.to_string()),
        version: Some(result.version.to_string()),
        vendor: Some(result.vendor.to_string()),
        device_type: Some(result.category.to_string()),
        os: Some(result.os.to_string()),
        device: Some(result.category.to_string()),
        os_version: Some(result.os_version.to_string()),
        browser_type: Some(result.browser_type.to_string())
    }
}