#[non_exhaustive]pub struct Emulation { /* private fields */ }Expand description
HTTP emulation configuration for mimicking different HTTP clients.
This struct combines transport-layer options (HTTP/1, HTTP/2, TLS) with request-level settings (headers, header case preservation) to provide a complete emulation profile for web browsers, mobile applications, API clients, and other HTTP implementations.
Implementations§
Source§impl Emulation
impl Emulation
Sourcepub fn builder() -> EmulationBuilder
pub fn builder() -> EmulationBuilder
Creates a new EmulationBuilder.
Sourcepub fn tls_options_mut(&mut self) -> &mut Option<TlsOptions>
pub fn tls_options_mut(&mut self) -> &mut Option<TlsOptions>
Returns a mutable reference to the TLS options, if set.
Sourcepub fn http1_options_mut(&mut self) -> &mut Option<Http1Options>
pub fn http1_options_mut(&mut self) -> &mut Option<Http1Options>
Returns a mutable reference to the HTTP/1 options, if set.
Sourcepub fn http2_options_mut(&mut self) -> &mut Option<Http2Options>
pub fn http2_options_mut(&mut self) -> &mut Option<Http2Options>
Returns a mutable reference to the HTTP/2 options, if set.
Sourcepub fn headers_mut(&mut self) -> &mut HeaderMap
pub fn headers_mut(&mut self) -> &mut HeaderMap
Returns a mutable reference to the emulation headers, if set.
Sourcepub fn orig_headers_mut(&mut self) -> &mut OrigHeaderMap
pub fn orig_headers_mut(&mut self) -> &mut OrigHeaderMap
Returns a mutable reference to the original headers, if set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Emulation
impl RefUnwindSafe for Emulation
impl Send for Emulation
impl Sync for Emulation
impl Unpin for Emulation
impl UnwindSafe for Emulation
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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>
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 more