Device
pub struct Device { /* private fields */ }The device data associated with a particular User-Agent string.
Methods
brand
View sourceThe brand of the client device, possibly different from the manufacturer of that device.
Parameters
- self: &Self
Returns
hwtype
View sourceA string representation of the primary client platform hardware. The most commonly used device types are also identified via boolean variables. Because a device may have multiple device types and this variable only has the primary type, we recommend using the boolean variables for logic and using this string representation for logging.
Parameters
- self: &Self
Returns
is_bot
View sourceThe client's User-Agent was recognized as belonging to a bot.
Parameters
- self: &Self
Returns
is_downloader
View sourceThe client's User-Agent was recognized as belonging to a downloader.
Parameters
- self: &Self
Returns
is_ereader
View sourceThe client device is a reading device (like a Kindle).
Parameters
- self: &Self
Returns
is_feedreader
View sourceThe client's User-Agent was recognized as belonging to a feedreader.
Parameters
- self: &Self
Returns
is_gameconsole
View sourceThe client device is a video game console (like a PlayStation or Xbox).
Parameters
- self: &Self
Returns
is_identified
View sourceThe client's User-Agent was identified.
This returns true when it is possible to populate client device properties
based on information supplied in the User-Agent. Which means that in each field of Device
we have at least one property that is Some(T).
Parameters
- self: &Self
Returns
is_mediaplayer
View sourceThe client device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo).
Parameters
- self: &Self
Returns
is_tablet
View sourceThe client device is a tablet (like an iPad).
Parameters
- self: &Self
Returns
is_touchscreen
View sourceThe client device's screen is touch sensitive.
Parameters
- self: &Self
Returns
is_tvplayer
View sourceThe client device is a set-top box or other TV player (like a Roku or Apple TV).
Parameters
- self: &Self
Returns
os_major_version
View sourceThe client Operating System's major version in SemVer format.
x in x.y.z-a
Parameters
- self: &Self
Returns
os_minor_version
View sourceThe client Operating System's major version in SemVer format.
y in x.y.z-a
Parameters
- self: &Self
Returns
os_name
View sourceThe name of the Operating System the client is using.
Parameters
- self: &Self
Returns
os_patch_minor_version
View sourceThe client Operating System's patch-minor version in SemVer format.
a in x.y.z-a
Parameters
- self: &Self
Returns
os_patch_version
View sourceThe client Operating System's patch version in SemVer format.
z in x.y.z-a
Parameters
- self: &Self
Returns
user_agent_bot_name
View sourceThe client identifies itself as a bot and provides a common name.
Parameters
- self: &Self
Returns
user_agent_major_version
View sourceThe client's browser major version in SemVer fashion.
x in x.y.z
Parameters
- self: &Self
Returns
user_agent_minor_version
View sourceThe client's browser minor version in SemVer fashion.
y in x.y.z
Parameters
- self: &Self
Returns
user_agent_name
View sourceThe name of the client's browser if known.
Parameters
- self: &Self
Returns
user_agent_patch_version
View sourceThe client's browser patch version in SemVer fashion.
z in x.y.z
Parameters
- self: &Self
Returns
Trait implementations
impl Debug for Device
impl Deserialize for Device
deserialize
View sourcewhere __D: Deserializer<'de>,Parameters
- __deserializer: __D
Returns
impl Serialize for Device
serialize
View sourcewhere __S: Serializer,Parameters
- self: &Self
- __serializer: __S
Returns