Rust

values

Module

What detection finds: the operating system, the client, the device and the bot behind a user-agent string.

Text is [Text]: a user-agent header may carry any byte, so names and versions read from it (a device model, a native app's bundle identifier) are the input's bytes, borrowed from it. Values from the detectors' tables are static.

Contents

use utopia_user_agent::Bot;
Rust
pub struct Bot<'a>

A bot a user-agent string names: a crawler, preview fetcher, monitor or automation tool.

use utopia_user_agent::Client;
Rust
pub struct Client<'a>

The client a user-agent string names: a browser, an HTTP library or a native app.

use utopia_user_agent::Device;
Rust
pub struct Device<'a>

The device a user-agent string names.

use utopia_user_agent::OperatingSystem;
Rust
pub struct OperatingSystem<'a>

The operating system a user-agent string names; every field is None when it names none.

Rust
pub type Text<'a> = Cow<'a, [u8]>

A text value: borrowed from the user-agent or from a static table, owned when detection rewrites it (17_4 becomes 17.4).