pub struct Emulation { /* private fields */ }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
impl Emulation
pub const Chrome100: Profile = Profile::Chrome100
pub const Chrome101: Profile = Profile::Chrome101
pub const Chrome104: Profile = Profile::Chrome104
pub const Chrome105: Profile = Profile::Chrome105
pub const Chrome106: Profile = Profile::Chrome106
pub const Chrome107: Profile = Profile::Chrome107
pub const Chrome108: Profile = Profile::Chrome108
pub const Chrome109: Profile = Profile::Chrome109
pub const Chrome110: Profile = Profile::Chrome110
pub const Chrome114: Profile = Profile::Chrome114
pub const Chrome116: Profile = Profile::Chrome116
pub const Chrome117: Profile = Profile::Chrome117
pub const Chrome118: Profile = Profile::Chrome118
pub const Chrome119: Profile = Profile::Chrome119
pub const Chrome120: Profile = Profile::Chrome120
pub const Chrome123: Profile = Profile::Chrome123
pub const Chrome124: Profile = Profile::Chrome124
pub const Chrome126: Profile = Profile::Chrome126
pub const Chrome127: Profile = Profile::Chrome127
pub const Chrome128: Profile = Profile::Chrome128
pub const Chrome129: Profile = Profile::Chrome129
pub const Chrome130: Profile = Profile::Chrome130
pub const Chrome131: Profile = Profile::Chrome131
pub const Chrome132: Profile = Profile::Chrome132
pub const Chrome133: Profile = Profile::Chrome133
pub const Chrome134: Profile = Profile::Chrome134
pub const Chrome135: Profile = Profile::Chrome135
pub const Chrome136: Profile = Profile::Chrome136
pub const Chrome137: Profile = Profile::Chrome137
pub const Chrome138: Profile = Profile::Chrome138
pub const Chrome139: Profile = Profile::Chrome139
pub const Chrome140: Profile = Profile::Chrome140
pub const Chrome141: Profile = Profile::Chrome141
pub const Chrome142: Profile = Profile::Chrome142
pub const Chrome143: Profile = Profile::Chrome143
pub const Chrome144: Profile = Profile::Chrome144
pub const Chrome145: Profile = Profile::Chrome145
pub const Chrome146: Profile = Profile::Chrome146
pub const Chrome147: Profile = Profile::Chrome147
pub const Chrome148: Profile = Profile::Chrome148
pub const Chrome149: Profile = Profile::Chrome149
pub const Edge101: Profile = Profile::Edge101
pub const Edge122: Profile = Profile::Edge122
pub const Edge127: Profile = Profile::Edge127
pub const Edge131: Profile = Profile::Edge131
pub const Edge134: Profile = Profile::Edge134
pub const Edge135: Profile = Profile::Edge135
pub const Edge136: Profile = Profile::Edge136
pub const Edge137: Profile = Profile::Edge137
pub const Edge138: Profile = Profile::Edge138
pub const Edge139: Profile = Profile::Edge139
pub const Edge140: Profile = Profile::Edge140
pub const Edge141: Profile = Profile::Edge141
pub const Edge142: Profile = Profile::Edge142
pub const Edge143: Profile = Profile::Edge143
pub const Edge144: Profile = Profile::Edge144
pub const Edge145: Profile = Profile::Edge145
pub const Edge146: Profile = Profile::Edge146
pub const Edge147: Profile = Profile::Edge147
pub const Edge148: Profile = Profile::Edge148
pub const Opera116: Profile = Profile::Opera116
pub const Opera117: Profile = Profile::Opera117
pub const Opera118: Profile = Profile::Opera118
pub const Opera119: Profile = Profile::Opera119
pub const Opera120: Profile = Profile::Opera120
pub const Opera121: Profile = Profile::Opera121
pub const Opera122: Profile = Profile::Opera122
pub const Opera123: Profile = Profile::Opera123
pub const Opera124: Profile = Profile::Opera124
pub const Opera125: Profile = Profile::Opera125
pub const Opera126: Profile = Profile::Opera126
pub const Opera127: Profile = Profile::Opera127
pub const Opera128: Profile = Profile::Opera128
pub const Opera129: Profile = Profile::Opera129
pub const Opera130: Profile = Profile::Opera130
pub const Opera131: Profile = Profile::Opera131
pub const Firefox109: Profile = Profile::Firefox109
pub const Firefox117: Profile = Profile::Firefox117
pub const Firefox128: Profile = Profile::Firefox128
pub const Firefox133: Profile = Profile::Firefox133
pub const Firefox135: Profile = Profile::Firefox135
pub const FirefoxPrivate135: Profile = Profile::FirefoxPrivate135
pub const FirefoxAndroid135: Profile = Profile::FirefoxAndroid135
pub const Firefox136: Profile = Profile::Firefox136
pub const FirefoxPrivate136: Profile = Profile::FirefoxPrivate136
pub const Firefox139: Profile = Profile::Firefox139
pub const Firefox142: Profile = Profile::Firefox142
pub const Firefox143: Profile = Profile::Firefox143
pub const Firefox144: Profile = Profile::Firefox144
pub const Firefox145: Profile = Profile::Firefox145
pub const Firefox146: Profile = Profile::Firefox146
pub const Firefox147: Profile = Profile::Firefox147
pub const Firefox148: Profile = Profile::Firefox148
pub const Firefox149: Profile = Profile::Firefox149
pub const Firefox150: Profile = Profile::Firefox150
pub const Firefox151: Profile = Profile::Firefox151
pub const SafariIos17_2: Profile = Profile::SafariIos17_2
pub const SafariIos17_4_1: Profile = Profile::SafariIos17_4_1
pub const SafariIos16_5: Profile = Profile::SafariIos16_5
pub const Safari15_3: Profile = Profile::Safari15_3
pub const Safari15_5: Profile = Profile::Safari15_5
pub const Safari15_6_1: Profile = Profile::Safari15_6_1
pub const Safari16: Profile = Profile::Safari16
pub const Safari16_5: Profile = Profile::Safari16_5
pub const Safari17_0: Profile = Profile::Safari17_0
pub const Safari17_2_1: Profile = Profile::Safari17_2_1
pub const Safari17_4_1: Profile = Profile::Safari17_4_1
pub const Safari17_5: Profile = Profile::Safari17_5
pub const Safari17_6: Profile = Profile::Safari17_6
pub const Safari18: Profile = Profile::Safari18
pub const SafariIPad18: Profile = Profile::SafariIPad18
pub const Safari18_2: Profile = Profile::Safari18_2
pub const SafariIos18_1_1: Profile = Profile::SafariIos18_1_1
pub const Safari18_3: Profile = Profile::Safari18_3
pub const Safari18_3_1: Profile = Profile::Safari18_3_1
pub const Safari18_5: Profile = Profile::Safari18_5
pub const Safari26: Profile = Profile::Safari26
pub const Safari26_1: Profile = Profile::Safari26_1
pub const Safari26_2: Profile = Profile::Safari26_2
pub const Safari26_3: Profile = Profile::Safari26_3
pub const Safari26_4: Profile = Profile::Safari26_4
pub const SafariIPad26: Profile = Profile::SafariIPad26
pub const SafariIpad26_2: Profile = Profile::SafariIpad26_2
pub const SafariIos26: Profile = Profile::SafariIos26
pub const SafariIos26_2: Profile = Profile::SafariIos26_2
pub const OkHttp3_9: Profile = Profile::OkHttp3_9
pub const OkHttp3_11: Profile = Profile::OkHttp3_11
pub const OkHttp3_13: Profile = Profile::OkHttp3_13
pub const OkHttp3_14: Profile = Profile::OkHttp3_14
pub const OkHttp4_9: Profile = Profile::OkHttp4_9
pub const OkHttp4_10: Profile = Profile::OkHttp4_10
pub const OkHttp4_12: Profile = Profile::OkHttp4_12
pub const OkHttp5: Profile = Profile::OkHttp5
Source§impl Emulation
impl Emulation
Sourcepub fn builder() -> EmulationBuilder<((), (), (), ())>
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
impl Emulation
Sourcepub fn random() -> Emulation
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);Sourcepub fn weighted_random() -> Emulation
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 IntoEmulation for Emulation
impl IntoEmulation for Emulation
Source§fn into_emulation(self) -> Emulation
fn into_emulation(self) -> Emulation
self into an Emulation configuration.Auto Trait Implementations§
impl Freeze for Emulation
impl RefUnwindSafe for Emulation
impl Send for Emulation
impl Sync for Emulation
impl Unpin for Emulation
impl UnsafeUnpin for Emulation
impl UnwindSafe for Emulation
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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