Skip to main content

Emulation

Struct Emulation 

Source
pub struct Emulation { /* private fields */ }
Available on crate feature emulation only.
Expand description

Represents the configuration options for emulating a client profile and platform.

The Emulation struct allows you to configure various aspects of profile and platform emulation, including the profile, platform, and whether to enable certain features like HTTP/2 or headers.

Implementations§

Source§

impl Emulation

Source

pub const Chrome100: Profile = Profile::Chrome100

Source

pub const Chrome101: Profile = Profile::Chrome101

Source

pub const Chrome104: Profile = Profile::Chrome104

Source

pub const Chrome105: Profile = Profile::Chrome105

Source

pub const Chrome106: Profile = Profile::Chrome106

Source

pub const Chrome107: Profile = Profile::Chrome107

Source

pub const Chrome108: Profile = Profile::Chrome108

Source

pub const Chrome109: Profile = Profile::Chrome109

Source

pub const Chrome110: Profile = Profile::Chrome110

Source

pub const Chrome114: Profile = Profile::Chrome114

Source

pub const Chrome116: Profile = Profile::Chrome116

Source

pub const Chrome117: Profile = Profile::Chrome117

Source

pub const Chrome118: Profile = Profile::Chrome118

Source

pub const Chrome119: Profile = Profile::Chrome119

Source

pub const Chrome120: Profile = Profile::Chrome120

Source

pub const Chrome123: Profile = Profile::Chrome123

Source

pub const Chrome124: Profile = Profile::Chrome124

Source

pub const Chrome126: Profile = Profile::Chrome126

Source

pub const Chrome127: Profile = Profile::Chrome127

Source

pub const Chrome128: Profile = Profile::Chrome128

Source

pub const Chrome129: Profile = Profile::Chrome129

Source

pub const Chrome130: Profile = Profile::Chrome130

Source

pub const Chrome131: Profile = Profile::Chrome131

Source

pub const Chrome132: Profile = Profile::Chrome132

Source

pub const Chrome133: Profile = Profile::Chrome133

Source

pub const Chrome134: Profile = Profile::Chrome134

Source

pub const Chrome135: Profile = Profile::Chrome135

Source

pub const Chrome136: Profile = Profile::Chrome136

Source

pub const Chrome137: Profile = Profile::Chrome137

Source

pub const Chrome138: Profile = Profile::Chrome138

Source

pub const Chrome139: Profile = Profile::Chrome139

Source

pub const Chrome140: Profile = Profile::Chrome140

Source

pub const Chrome141: Profile = Profile::Chrome141

Source

pub const Chrome142: Profile = Profile::Chrome142

Source

pub const Chrome143: Profile = Profile::Chrome143

Source

pub const Chrome144: Profile = Profile::Chrome144

Source

pub const Chrome145: Profile = Profile::Chrome145

Source

pub const Chrome146: Profile = Profile::Chrome146

Source

pub const Chrome147: Profile = Profile::Chrome147

Source

pub const Chrome148: Profile = Profile::Chrome148

Source

pub const Chrome149: Profile = Profile::Chrome149

Source

pub const Edge101: Profile = Profile::Edge101

Source

pub const Edge122: Profile = Profile::Edge122

Source

pub const Edge127: Profile = Profile::Edge127

Source

pub const Edge131: Profile = Profile::Edge131

Source

pub const Edge134: Profile = Profile::Edge134

Source

pub const Edge135: Profile = Profile::Edge135

Source

pub const Edge136: Profile = Profile::Edge136

Source

pub const Edge137: Profile = Profile::Edge137

Source

pub const Edge138: Profile = Profile::Edge138

Source

pub const Edge139: Profile = Profile::Edge139

Source

pub const Edge140: Profile = Profile::Edge140

Source

pub const Edge141: Profile = Profile::Edge141

Source

pub const Edge142: Profile = Profile::Edge142

Source

pub const Edge143: Profile = Profile::Edge143

Source

pub const Edge144: Profile = Profile::Edge144

Source

pub const Edge145: Profile = Profile::Edge145

Source

pub const Edge146: Profile = Profile::Edge146

Source

pub const Edge147: Profile = Profile::Edge147

Source

pub const Edge148: Profile = Profile::Edge148

Source

pub const Opera116: Profile = Profile::Opera116

Source

pub const Opera117: Profile = Profile::Opera117

Source

pub const Opera118: Profile = Profile::Opera118

Source

pub const Opera119: Profile = Profile::Opera119

Source

pub const Opera120: Profile = Profile::Opera120

Source

pub const Opera121: Profile = Profile::Opera121

Source

pub const Opera122: Profile = Profile::Opera122

Source

pub const Opera123: Profile = Profile::Opera123

Source

pub const Opera124: Profile = Profile::Opera124

Source

pub const Opera125: Profile = Profile::Opera125

Source

pub const Opera126: Profile = Profile::Opera126

Source

pub const Opera127: Profile = Profile::Opera127

Source

pub const Opera128: Profile = Profile::Opera128

Source

pub const Opera129: Profile = Profile::Opera129

Source

pub const Opera130: Profile = Profile::Opera130

Source

pub const Opera131: Profile = Profile::Opera131

Source

pub const Firefox109: Profile = Profile::Firefox109

Source

pub const Firefox117: Profile = Profile::Firefox117

Source

pub const Firefox128: Profile = Profile::Firefox128

Source

pub const Firefox133: Profile = Profile::Firefox133

Source

pub const Firefox135: Profile = Profile::Firefox135

Source

pub const FirefoxPrivate135: Profile = Profile::FirefoxPrivate135

Source

pub const FirefoxAndroid135: Profile = Profile::FirefoxAndroid135

Source

pub const Firefox136: Profile = Profile::Firefox136

Source

pub const FirefoxPrivate136: Profile = Profile::FirefoxPrivate136

Source

pub const Firefox139: Profile = Profile::Firefox139

Source

pub const Firefox142: Profile = Profile::Firefox142

Source

pub const Firefox143: Profile = Profile::Firefox143

Source

pub const Firefox144: Profile = Profile::Firefox144

Source

pub const Firefox145: Profile = Profile::Firefox145

Source

pub const Firefox146: Profile = Profile::Firefox146

Source

pub const Firefox147: Profile = Profile::Firefox147

Source

pub const Firefox148: Profile = Profile::Firefox148

Source

pub const Firefox149: Profile = Profile::Firefox149

Source

pub const Firefox150: Profile = Profile::Firefox150

Source

pub const Firefox151: Profile = Profile::Firefox151

Source

pub const SafariIos17_2: Profile = Profile::SafariIos17_2

Source

pub const SafariIos17_4_1: Profile = Profile::SafariIos17_4_1

Source

pub const SafariIos16_5: Profile = Profile::SafariIos16_5

Source

pub const Safari15_3: Profile = Profile::Safari15_3

Source

pub const Safari15_5: Profile = Profile::Safari15_5

Source

pub const Safari15_6_1: Profile = Profile::Safari15_6_1

Source

pub const Safari16: Profile = Profile::Safari16

Source

pub const Safari16_5: Profile = Profile::Safari16_5

Source

pub const Safari17_0: Profile = Profile::Safari17_0

Source

pub const Safari17_2_1: Profile = Profile::Safari17_2_1

Source

pub const Safari17_4_1: Profile = Profile::Safari17_4_1

Source

pub const Safari17_5: Profile = Profile::Safari17_5

Source

pub const Safari17_6: Profile = Profile::Safari17_6

Source

pub const Safari18: Profile = Profile::Safari18

Source

pub const SafariIPad18: Profile = Profile::SafariIPad18

Source

pub const Safari18_2: Profile = Profile::Safari18_2

Source

pub const SafariIos18_1_1: Profile = Profile::SafariIos18_1_1

Source

pub const Safari18_3: Profile = Profile::Safari18_3

Source

pub const Safari18_3_1: Profile = Profile::Safari18_3_1

Source

pub const Safari18_5: Profile = Profile::Safari18_5

Source

pub const Safari26: Profile = Profile::Safari26

Source

pub const Safari26_1: Profile = Profile::Safari26_1

Source

pub const Safari26_2: Profile = Profile::Safari26_2

Source

pub const Safari26_3: Profile = Profile::Safari26_3

Source

pub const Safari26_4: Profile = Profile::Safari26_4

Source

pub const SafariIPad26: Profile = Profile::SafariIPad26

Source

pub const SafariIpad26_2: Profile = Profile::SafariIpad26_2

Source

pub const SafariIos26: Profile = Profile::SafariIos26

Source

pub const SafariIos26_2: Profile = Profile::SafariIos26_2

Source

pub const OkHttp3_9: Profile = Profile::OkHttp3_9

Source

pub const OkHttp3_11: Profile = Profile::OkHttp3_11

Source

pub const OkHttp3_13: Profile = Profile::OkHttp3_13

Source

pub const OkHttp3_14: Profile = Profile::OkHttp3_14

Source

pub const OkHttp4_9: Profile = Profile::OkHttp4_9

Source

pub const OkHttp4_10: Profile = Profile::OkHttp4_10

Source

pub const OkHttp4_12: Profile = Profile::OkHttp4_12

Source

pub const OkHttp5: Profile = Profile::OkHttp5

Source§

impl Emulation

Source

pub fn builder() -> EmulationBuilder<((), (), (), ())>

Create a builder for building Emulation. On the builder, call .profile(...)(optional), .platform(...)(optional), .http2(...)(optional), .headers(...)(optional) to set the values of the fields. Finally, call .build() to create the instance of Emulation.

Source§

impl Emulation

Source

pub fn random() -> Emulation

Returns a random variant of the Profile enum.

§Examples
use wreq_util::Emulation;

let random_emulation = Emulation::random();
println!("{:?}", random_emulation);
Source

pub fn weighted_random() -> Emulation

Returns a market-share weighted random Emulation.

Unlike Emulation::random, selection is biased toward popular browser families and their most recent versions, and each profile is only paired with platforms it ships on.

Browser family and version weights are derived from StatCounter Global Stats data retrieved in June 2026:

Browser market share: https://gs.statcounter.com/browser-market-share#monthly-202506-202606

Browser version market share: https://gs.statcounter.com/browser-version-market-share#monthly-202506-202606

StatCounter requests attribution for use of its data. See: https://creativecommons.org/licenses/by-sa/3.0/

§Examples
use wreq_util::Emulation;

let random_emulation = Emulation::weighted_random();
println!("{:?}", random_emulation);

Trait Implementations§

Source§

impl Clone for Emulation

Source§

fn clone(&self) -> Emulation

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Emulation

Source§

fn default() -> Emulation

Returns the “default value” for a type. Read more
Source§

impl IntoEmulation for Emulation

Source§

fn into_emulation(self) -> Emulation

Converts self into an Emulation configuration.

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

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>,

Source§

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> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more