Struct ProfileEmulateLayer
pub struct ProfileEmulateLayer<P = Arc<UserAgentDatabase>> { /* private fields */ }std and ua only.Expand description
Select a captured profile and publish its immutable emulation context.
Requests without an explicit RequestInitiator select a top-level
navigation flow. Missing Sec-Fetch-* headers do not constrain selection;
the chosen captured navigation supplies its profile-owned Fetch metadata.
The selected identity follows the configured ProfileSelector, completed by a
UserAgent request extension or, with auto-detection, the request’s own
User-Agent header.
A request keeps parts of its own identity with the PreserveHeaderUserAgent
and PreserveClientHints extensions, or a UserAgent extension whose HTTP
or TLS agent is Preserve. Each kept part is listed in the request’s
ProfilePreservationReport and never fails the request.
Implementations§
§impl<P> ProfileEmulateLayer<P>
impl<P> ProfileEmulateLayer<P>
pub fn new(source: P) -> ProfileEmulateLayer<P>
pub fn with_selector(self, selector: ProfileSelector) -> ProfileEmulateLayer<P>
pub fn with_selector(self, selector: ProfileSelector) -> ProfileEmulateLayer<P>
Restrict captured profile selection.
pub fn set_selector(
&mut self,
selector: ProfileSelector,
) -> &mut ProfileEmulateLayer<P>
pub fn set_selector( &mut self, selector: ProfileSelector, ) -> &mut ProfileEmulateLayer<P>
Restrict captured profile selection.
pub fn maybe_with_seed(
self,
seed: Option<ProfileSeed>,
) -> ProfileEmulateLayer<P>
pub fn maybe_with_seed( self, seed: Option<ProfileSeed>, ) -> ProfileEmulateLayer<P>
Fix the profile seed for reproducible selection.
pub fn maybe_set_seed(
&mut self,
seed: Option<ProfileSeed>,
) -> &mut ProfileEmulateLayer<P>
pub fn maybe_set_seed( &mut self, seed: Option<ProfileSeed>, ) -> &mut ProfileEmulateLayer<P>
Fix the profile seed for reproducible selection.
pub fn with_seed(self, seed: ProfileSeed) -> ProfileEmulateLayer<P>
pub fn with_seed(self, seed: ProfileSeed) -> ProfileEmulateLayer<P>
Fix the profile seed for reproducible selection.
pub fn set_seed(&mut self, seed: ProfileSeed) -> &mut ProfileEmulateLayer<P>
pub fn set_seed(&mut self, seed: ProfileSeed) -> &mut ProfileEmulateLayer<P>
Fix the profile seed for reproducible selection.
pub fn without_seed(self) -> ProfileEmulateLayer<P>
pub fn without_seed(self) -> ProfileEmulateLayer<P>
Fix the profile seed for reproducible selection.
pub fn unset_seed(&mut self) -> &mut ProfileEmulateLayer<P>
pub fn unset_seed(&mut self) -> &mut ProfileEmulateLayer<P>
Fix the profile seed for reproducible selection.
pub fn maybe_with_connection_key(
self,
key: Option<DrawKey>,
) -> ProfileEmulateLayer<P>
pub fn maybe_with_connection_key( self, key: Option<DrawKey>, ) -> ProfileEmulateLayer<P>
Fix the logical connection draw key.
pub fn maybe_set_connection_key(
&mut self,
key: Option<DrawKey>,
) -> &mut ProfileEmulateLayer<P>
pub fn maybe_set_connection_key( &mut self, key: Option<DrawKey>, ) -> &mut ProfileEmulateLayer<P>
Fix the logical connection draw key.
pub fn with_connection_key(self, key: DrawKey) -> ProfileEmulateLayer<P>
pub fn with_connection_key(self, key: DrawKey) -> ProfileEmulateLayer<P>
Fix the logical connection draw key.
pub fn set_connection_key(
&mut self,
key: DrawKey,
) -> &mut ProfileEmulateLayer<P>
pub fn set_connection_key( &mut self, key: DrawKey, ) -> &mut ProfileEmulateLayer<P>
Fix the logical connection draw key.
pub fn without_connection_key(self) -> ProfileEmulateLayer<P>
pub fn without_connection_key(self) -> ProfileEmulateLayer<P>
Fix the logical connection draw key.
pub fn unset_connection_key(&mut self) -> &mut ProfileEmulateLayer<P>
pub fn unset_connection_key(&mut self) -> &mut ProfileEmulateLayer<P>
Fix the logical connection draw key.
pub fn maybe_with_request_key(
self,
key: Option<DrawKey>,
) -> ProfileEmulateLayer<P>
pub fn maybe_with_request_key( self, key: Option<DrawKey>, ) -> ProfileEmulateLayer<P>
Fix the logical request draw key.
pub fn maybe_set_request_key(
&mut self,
key: Option<DrawKey>,
) -> &mut ProfileEmulateLayer<P>
pub fn maybe_set_request_key( &mut self, key: Option<DrawKey>, ) -> &mut ProfileEmulateLayer<P>
Fix the logical request draw key.
pub fn with_request_key(self, key: DrawKey) -> ProfileEmulateLayer<P>
pub fn with_request_key(self, key: DrawKey) -> ProfileEmulateLayer<P>
Fix the logical request draw key.
pub fn set_request_key(&mut self, key: DrawKey) -> &mut ProfileEmulateLayer<P>
pub fn set_request_key(&mut self, key: DrawKey) -> &mut ProfileEmulateLayer<P>
Fix the logical request draw key.
pub fn without_request_key(self) -> ProfileEmulateLayer<P>
pub fn without_request_key(self) -> ProfileEmulateLayer<P>
Fix the logical request draw key.
pub fn unset_request_key(&mut self) -> &mut ProfileEmulateLayer<P>
pub fn unset_request_key(&mut self) -> &mut ProfileEmulateLayer<P>
Fix the logical request draw key.
pub fn with_pins(self, pins: VariantPins) -> ProfileEmulateLayer<P>
pub fn with_pins(self, pins: VariantPins) -> ProfileEmulateLayer<P>
Pin stored connection and request variants.
pub fn set_pins(&mut self, pins: VariantPins) -> &mut ProfileEmulateLayer<P>
pub fn set_pins(&mut self, pins: VariantPins) -> &mut ProfileEmulateLayer<P>
Pin stored connection and request variants.
pub fn with_is_optional(self, optional: bool) -> ProfileEmulateLayer<P>
pub fn with_is_optional(self, optional: bool) -> ProfileEmulateLayer<P>
Pass requests through unchanged, with a debug trace, when they cannot be emulated instead of failing them.
pub fn set_is_optional(&mut self, optional: bool) -> &mut ProfileEmulateLayer<P>
pub fn set_is_optional(&mut self, optional: bool) -> &mut ProfileEmulateLayer<P>
Pass requests through unchanged, with a debug trace, when they cannot be emulated instead of failing them.
pub fn with_try_auto_detect_user_agent(
self,
detect: bool,
) -> ProfileEmulateLayer<P>
pub fn with_try_auto_detect_user_agent( self, detect: bool, ) -> ProfileEmulateLayer<P>
pub fn set_try_auto_detect_user_agent(
&mut self,
detect: bool,
) -> &mut ProfileEmulateLayer<P>
pub fn set_try_auto_detect_user_agent( &mut self, detect: bool, ) -> &mut ProfileEmulateLayer<P>
pub fn with_select_fallback(
self,
fallback: ProfileSelectFallback,
) -> ProfileEmulateLayer<P>
pub fn with_select_fallback( self, fallback: ProfileSelectFallback, ) -> ProfileEmulateLayer<P>
Choose how to relax the selector when no profile matches it.
pub fn set_select_fallback(
&mut self,
fallback: ProfileSelectFallback,
) -> &mut ProfileEmulateLayer<P>
pub fn set_select_fallback( &mut self, fallback: ProfileSelectFallback, ) -> &mut ProfileEmulateLayer<P>
Choose how to relax the selector when no profile matches it.
pub fn maybe_with_input_header_order(
self,
name: Option<HeaderName>,
) -> ProfileEmulateLayer<P>
pub fn maybe_with_input_header_order( self, name: Option<HeaderName>, ) -> ProfileEmulateLayer<P>
Name a request header holding a comma-separated list of header names.
Caller headers the profile does not own are emitted in that order, ahead of other caller headers. The header itself is removed from the request.
pub fn maybe_set_input_header_order(
&mut self,
name: Option<HeaderName>,
) -> &mut ProfileEmulateLayer<P>
pub fn maybe_set_input_header_order( &mut self, name: Option<HeaderName>, ) -> &mut ProfileEmulateLayer<P>
Name a request header holding a comma-separated list of header names.
Caller headers the profile does not own are emitted in that order, ahead of other caller headers. The header itself is removed from the request.
pub fn with_input_header_order(self, name: HeaderName) -> ProfileEmulateLayer<P>
pub fn with_input_header_order(self, name: HeaderName) -> ProfileEmulateLayer<P>
Name a request header holding a comma-separated list of header names.
Caller headers the profile does not own are emitted in that order, ahead of other caller headers. The header itself is removed from the request.
pub fn set_input_header_order(
&mut self,
name: HeaderName,
) -> &mut ProfileEmulateLayer<P>
pub fn set_input_header_order( &mut self, name: HeaderName, ) -> &mut ProfileEmulateLayer<P>
Name a request header holding a comma-separated list of header names.
Caller headers the profile does not own are emitted in that order, ahead of other caller headers. The header itself is removed from the request.
pub fn without_input_header_order(self) -> ProfileEmulateLayer<P>
pub fn without_input_header_order(self) -> ProfileEmulateLayer<P>
Name a request header holding a comma-separated list of header names.
Caller headers the profile does not own are emitted in that order, ahead of other caller headers. The header itself is removed from the request.
pub fn unset_input_header_order(&mut self) -> &mut ProfileEmulateLayer<P>
pub fn unset_input_header_order(&mut self) -> &mut ProfileEmulateLayer<P>
Name a request header holding a comma-separated list of header names.
Caller headers the profile does not own are emitted in that order, ahead of other caller headers. The header itself is removed from the request.
Trait Implementations§
§impl<P> Clone for ProfileEmulateLayer<P>where
P: Clone,
impl<P> Clone for ProfileEmulateLayer<P>where
P: Clone,
§fn clone(&self) -> ProfileEmulateLayer<P>
fn clone(&self) -> ProfileEmulateLayer<P>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl<P> Debug for ProfileEmulateLayer<P>where
P: Debug,
impl<P> Debug for ProfileEmulateLayer<P>where
P: Debug,
§impl<S, P> Layer<S> for ProfileEmulateLayer<P>where
P: Clone,
impl<S, P> Layer<S> for ProfileEmulateLayer<P>where
P: Clone,
§type Service = ProfileEmulateService<S, P>
type Service = ProfileEmulateService<S, P>
§fn layer(&self, inner: S) -> <ProfileEmulateLayer<P> as Layer<S>>::Service
fn layer(&self, inner: S) -> <ProfileEmulateLayer<P> as Layer<S>>::Service
§fn into_layer(self, inner: S) -> <ProfileEmulateLayer<P> as Layer<S>>::Service
fn into_layer(self, inner: S) -> <ProfileEmulateLayer<P> as Layer<S>>::Service
layer but consuming self after the service was created. Read moreAuto Trait Implementations§
impl<P = Arc<UserAgentDatabase>> !Freeze for ProfileEmulateLayer<P>
impl<P> RefUnwindSafe for ProfileEmulateLayer<P>where
P: RefUnwindSafe,
impl<P> Send for ProfileEmulateLayer<P>where
P: Send,
impl<P> Sync for ProfileEmulateLayer<P>where
P: Sync,
impl<P> Unpin for ProfileEmulateLayer<P>where
P: Unpin,
impl<P> UnsafeUnpin for ProfileEmulateLayer<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for ProfileEmulateLayer<P>where
P: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more