pub struct DeviceEmulator { /* private fields */ }Expand description
Device emulator with preset device profiles
Implementations§
Source§impl DeviceEmulator
impl DeviceEmulator
Sourcepub fn register_preset(&mut self, device: DeviceDescriptor)
pub fn register_preset(&mut self, device: DeviceDescriptor)
Register a custom device preset
Sourcepub fn get_preset(&self, name: &str) -> Option<&DeviceDescriptor>
pub fn get_preset(&self, name: &str) -> Option<&DeviceDescriptor>
Get a device preset by name
Sourcepub fn preset_names(&self) -> Vec<&str>
pub fn preset_names(&self) -> Vec<&str>
Get all preset names
Sourcepub fn custom(viewport: Viewport, user_agent: &str) -> DeviceDescriptor
pub fn custom(viewport: Viewport, user_agent: &str) -> DeviceDescriptor
Create a custom device
Sourcepub fn iphone_14() -> DeviceDescriptor
pub fn iphone_14() -> DeviceDescriptor
iPhone 14 device preset
Sourcepub fn iphone_14_pro() -> DeviceDescriptor
pub fn iphone_14_pro() -> DeviceDescriptor
iPhone 14 Pro device preset
Sourcepub fn iphone_14_pro_max() -> DeviceDescriptor
pub fn iphone_14_pro_max() -> DeviceDescriptor
iPhone 14 Pro Max device preset
Sourcepub fn ipad_pro() -> DeviceDescriptor
pub fn ipad_pro() -> DeviceDescriptor
iPad Pro 12.9“ device preset
Sourcepub fn ipad_mini() -> DeviceDescriptor
pub fn ipad_mini() -> DeviceDescriptor
iPad Mini device preset
Sourcepub fn pixel_7() -> DeviceDescriptor
pub fn pixel_7() -> DeviceDescriptor
Google Pixel 7 device preset
Sourcepub fn pixel_7_pro() -> DeviceDescriptor
pub fn pixel_7_pro() -> DeviceDescriptor
Google Pixel 7 Pro device preset
Sourcepub fn samsung_galaxy_s23() -> DeviceDescriptor
pub fn samsung_galaxy_s23() -> DeviceDescriptor
Samsung Galaxy S23 device preset
Sourcepub fn desktop_1080p() -> DeviceDescriptor
pub fn desktop_1080p() -> DeviceDescriptor
1080p Desktop preset
Sourcepub fn desktop_1440p() -> DeviceDescriptor
pub fn desktop_1440p() -> DeviceDescriptor
1440p Desktop preset
Sourcepub fn desktop_4k() -> DeviceDescriptor
pub fn desktop_4k() -> DeviceDescriptor
4K Desktop preset
Trait Implementations§
Source§impl Debug for DeviceEmulator
impl Debug for DeviceEmulator
Source§impl Default for DeviceEmulator
impl Default for DeviceEmulator
Source§fn default() -> DeviceEmulator
fn default() -> DeviceEmulator
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DeviceEmulator
impl RefUnwindSafe for DeviceEmulator
impl Send for DeviceEmulator
impl Sync for DeviceEmulator
impl Unpin for DeviceEmulator
impl UnsafeUnpin for DeviceEmulator
impl UnwindSafe for DeviceEmulator
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().