Struct UserAgentProfileInput
pub struct UserAgentProfileInput {Show 17 fields
pub uastr: String,
pub h1_settings: Option<Http1Settings>,
pub h1_headers_navigate: Option<HeaderMap>,
pub h1_headers_fetch: Option<HeaderMap>,
pub h1_headers_xhr: Option<HeaderMap>,
pub h1_headers_form: Option<HeaderMap>,
pub h1_headers_ws: Option<HeaderMap>,
pub h2_settings: Option<Http2Settings>,
pub h2_headers_navigate: Option<HeaderMap>,
pub h2_headers_fetch: Option<HeaderMap>,
pub h2_headers_xhr: Option<HeaderMap>,
pub h2_headers_form: Option<HeaderMap>,
pub h2_headers_ws: Option<HeaderMap>,
pub tls_client_hello: Option<ClientHello>,
pub tls_ws_client_config_overwrites: Option<WsClientConfigOverwrites>,
pub js_web_apis: Option<JsProfileWebApis>,
pub source_info: Option<UserAgentSourceInfo>,
}Available on crate features
std and ua only.Expand description
Serializable user-agent profile input used by Rama’s embedded and custom profile databases.
Fields are optional because fingerprint collection often observes HTTP/1,
HTTP/2 and TLS over separate connections. Multiple rows with the same
uastr can therefore be combined without inventing unobserved data.
Fields§
§uastr: String§h1_settings: Option<Http1Settings>§h1_headers_fetch: Option<HeaderMap>§h1_headers_xhr: Option<HeaderMap>§h1_headers_form: Option<HeaderMap>§h1_headers_ws: Option<HeaderMap>§h2_settings: Option<Http2Settings>§h2_headers_fetch: Option<HeaderMap>§h2_headers_xhr: Option<HeaderMap>§h2_headers_form: Option<HeaderMap>§h2_headers_ws: Option<HeaderMap>§tls_client_hello: Option<ClientHello>Available on crate feature
§tls only.tls_ws_client_config_overwrites: Option<WsClientConfigOverwrites>Available on crate feature
§tls only.js_web_apis: Option<JsProfileWebApis>§source_info: Option<UserAgentSourceInfo>Implementations§
§impl UserAgentProfileInput
impl UserAgentProfileInput
pub fn new(uastr: impl Into<String>) -> UserAgentProfileInput
pub fn new(uastr: impl Into<String>) -> UserAgentProfileInput
Create an empty captured profile row for a User-Agent value.
pub fn merge_missing(
&mut self,
other: UserAgentProfileInput,
) -> Result<(), Box<dyn Error + Sync + Send>>
pub fn merge_missing( &mut self, other: UserAgentProfileInput, ) -> Result<(), Box<dyn Error + Sync + Send>>
Fill fields absent from this row with observations from another row for the exact same User-Agent. Existing observations always win.
pub fn try_into_profile(
self,
) -> Result<UserAgentProfile, Box<dyn Error + Sync + Send>>
pub fn try_into_profile( self, ) -> Result<UserAgentProfile, Box<dyn Error + Sync + Send>>
Convert the row into a captured profile that can be emulated.
Each recorded header set becomes a request flow and the H2 settings and TLS ClientHello become connection observations. Nothing unrecorded is synthesized.
Trait Implementations§
§impl Clone for UserAgentProfileInput
impl Clone for UserAgentProfileInput
§fn clone(&self) -> UserAgentProfileInput
fn clone(&self) -> UserAgentProfileInput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read more§impl Debug for UserAgentProfileInput
impl Debug for UserAgentProfileInput
§impl<'de> Deserialize<'de> for UserAgentProfileInput
impl<'de> Deserialize<'de> for UserAgentProfileInput
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<UserAgentProfileInput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<UserAgentProfileInput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Serialize for UserAgentProfileInput
impl Serialize for UserAgentProfileInput
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Forget for UserAgentProfileInput
impl Freeze for UserAgentProfileInputwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
*const [Pos] is !null: Freeze,
PhantomData<[Pos]>: Freeze,
PhantomData<Bucket<HeaderValue>>: Freeze,
PhantomData<ExtraValue<HeaderValue>>: Freeze,
PhantomData<Option<Link>>: Freeze,
*const ColdState is !null: Freeze,
PhantomData<ColdState>: Freeze,
*const PseudoHeader is !null: Freeze,
PhantomData<PseudoHeader>: Freeze,
*const ArcInner<[EarlyFrame]> is !null: Freeze,
PhantomData<ArcInner<[EarlyFrame]>>: Freeze,
PhantomData<CipherSuite>: Freeze,
PhantomData<CompressionAlgorithm>: Freeze,
PhantomData<ClientHelloExtension>: Freeze,
PhantomData<ApplicationProtocol>: Freeze,
PhantomData<String>: Freeze,
impl Move for UserAgentProfileInput
impl RefUnwindSafe for UserAgentProfileInputwhere
Atomic<*mut ()>: RefUnwindSafe,
PseudoHeader: RefUnwindSafe,
Atomic<usize>: RefUnwindSafe,
SettingId: RefUnwindSafe,
impl Send for UserAgentProfileInput
impl Sync for UserAgentProfileInputwhere
RawVecInner: Sync,
BoxRaw<[Pos]>: Sync,
Bytes: Sync,
BoxRaw<ColdState>: Sync,
SmallVecData<[PseudoHeader; 5]>: Sync,
PseudoHeader: Sync,
Arc<[EarlyFrame]>: Sync,
impl Unpin for UserAgentProfileInput
impl UnsafeUnpin for UserAgentProfileInputwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
*const [Pos] is !null: UnsafeUnpin,
PhantomData<[Pos]>: UnsafeUnpin,
PhantomData<Bucket<HeaderValue>>: UnsafeUnpin,
PhantomData<ExtraValue<HeaderValue>>: UnsafeUnpin,
PhantomData<Option<Link>>: UnsafeUnpin,
*const ColdState is !null: UnsafeUnpin,
PhantomData<ColdState>: UnsafeUnpin,
*const PseudoHeader is !null: UnsafeUnpin,
PhantomData<PseudoHeader>: UnsafeUnpin,
*const ArcInner<[EarlyFrame]> is !null: UnsafeUnpin,
PhantomData<ArcInner<[EarlyFrame]>>: UnsafeUnpin,
PhantomData<CipherSuite>: UnsafeUnpin,
PhantomData<CompressionAlgorithm>: UnsafeUnpin,
PhantomData<ClientHelloExtension>: UnsafeUnpin,
PhantomData<ApplicationProtocol>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
impl UnwindSafe for UserAgentProfileInputwhere
RawVecInner: UnwindSafe,
BoxRaw<[Pos]>: UnwindSafe,
*const u8: UnwindSafe,
Align8<*mut ()>: UnwindSafe,
&'static Vtable: UnwindSafe,
BoxRaw<ColdState>: UnwindSafe,
NonNull<PseudoHeader>: UnwindSafe,
PseudoHeader: UnwindSafe,
Arc<[EarlyFrame]>: 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
Mutably borrows from an owned value. Read more
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
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>
Create a new
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more