Trait UserAgentProvider

pub trait UserAgentProvider:
    Send
    + Sync
    + 'static {
    // Required method
    fn select_user_agent_profile(
        &self,
        ctx: &Context,
    ) -> Option<&UserAgentProfile>;
}
Expand description

A trait for providing user agent profiles for emulation.

This trait is used to select a user agent profile based on the current context. It’s a core component of the user agent emulation system, allowing different strategies for selecting which user agent profile to use for a request.

Rama provides several built-in implementations:

This trait is typically used by UserAgentEmulateService to select an appropriate user agent profile for HTTP request emulation.

Required Methods§

fn select_user_agent_profile(&self, ctx: &Context) -> Option<&UserAgentProfile>

Selects a user agent profile based on the current context.

Implementations on Foreign Types§

§

impl UserAgentProvider for ()

§

impl<P> UserAgentProvider for Arc<P>

Implementors§

§

impl UserAgentProvider for UserAgentDatabase

§

impl UserAgentProvider for UserAgentProfile

§

impl<A, B> UserAgentProvider for Either<A, B>

§

impl<A, B, C> UserAgentProvider for Either3<A, B, C>

§

impl<A, B, C, D> UserAgentProvider for Either4<A, B, C, D>

§

impl<A, B, C, D, E> UserAgentProvider for Either5<A, B, C, D, E>

§

impl<A, B, C, D, E, F> UserAgentProvider for Either6<A, B, C, D, E, F>

§

impl<A, B, C, D, E, F, G> UserAgentProvider for Either7<A, B, C, D, E, F, G>

§

impl<A, B, C, D, E, F, G, H> UserAgentProvider for Either8<A, B, C, D, E, F, G, H>

§

impl<A, B, C, D, E, F, G, H, I> UserAgentProvider for Either9<A, B, C, D, E, F, G, H, I>

§

impl<P> UserAgentProvider for Option<P>

§

impl<P> UserAgentProvider for Box<P>