pub struct Device { /* private fields */ }
Expand description

The device data associated with a particular User-Agent string.

Implementations§

source§

impl Device

source

pub fn device_name(&self) -> Option<&str>

The name of the client device.

source

pub fn brand(&self) -> Option<&str>

The brand of the client device, possibly different from the manufacturer of that device.

source

pub fn model(&self) -> Option<&str>

The model of the client device.

source

pub fn hwtype(&self) -> Option<&str>

A 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.

source

pub fn is_ereader(&self) -> Option<bool>

The client device is a reading device (like a Kindle).

source

pub fn is_gameconsole(&self) -> Option<bool>

The client device is a video game console (like a PlayStation or Xbox).

source

pub fn is_mediaplayer(&self) -> Option<bool>

The client device is a media player (like Blu-ray players, iPod devices, and smart speakers such as Amazon Echo).

source

pub fn is_mobile(&self) -> Option<bool>

The client device is a mobile phone.

source

pub fn is_smarttv(&self) -> Option<bool>

The client device is a smart TV.

source

pub fn is_tablet(&self) -> Option<bool>

The client device is a tablet (like an iPad).

source

pub fn is_tvplayer(&self) -> Option<bool>

The client device is a set-top box or other TV player (like a Roku or Apple TV).

source

pub fn is_desktop(&self) -> Option<bool>

The client is a desktop web browser.

source

pub fn is_touchscreen(&self) -> Option<bool>

The client device’s screen is touch sensitive.

Trait Implementations§

source§

impl Debug for Device

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Device

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for Device

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,