pub struct DeviceDescriptor {
pub name: &'static str,
pub user_agent: &'static str,
pub viewport: ViewportSize,
pub device_scale_factor: f64,
pub is_mobile: bool,
pub has_touch: bool,
pub default_browser_type: BrowserType,
}Expand description
A device descriptor containing all properties needed to emulate a device.
Device descriptors include viewport dimensions, user agent strings, device scale factor, and touch/mobile capabilities.
Fields§
§name: &'static strHuman-readable device name.
user_agent: &'static strUser agent string for this device.
viewport: ViewportSizeViewport dimensions.
device_scale_factor: f64Device pixel ratio (scale factor).
is_mobile: boolWhether the device is a mobile device.
has_touch: boolWhether the device has touch capability.
default_browser_type: BrowserTypeDefault browser type for this device.
Implementations§
Source§impl DeviceDescriptor
impl DeviceDescriptor
Sourcepub const fn new(
name: &'static str,
user_agent: &'static str,
viewport: ViewportSize,
device_scale_factor: f64,
is_mobile: bool,
has_touch: bool,
default_browser_type: BrowserType,
) -> Self
pub const fn new( name: &'static str, user_agent: &'static str, viewport: ViewportSize, device_scale_factor: f64, is_mobile: bool, has_touch: bool, default_browser_type: BrowserType, ) -> Self
Create a new device descriptor.
Trait Implementations§
Source§impl Clone for DeviceDescriptor
impl Clone for DeviceDescriptor
Source§fn clone(&self) -> DeviceDescriptor
fn clone(&self) -> DeviceDescriptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DeviceDescriptor
impl RefUnwindSafe for DeviceDescriptor
impl Send for DeviceDescriptor
impl Sync for DeviceDescriptor
impl Unpin for DeviceDescriptor
impl UnwindSafe for DeviceDescriptor
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more