Struct ProxyFilter
pub struct ProxyFilter {
pub id: Option<NonEmptyString>,
pub pool_id: Option<Vec<StringFilter>>,
pub continent: Option<Vec<StringFilter>>,
pub country: Option<Vec<StringFilter>>,
pub state: Option<Vec<StringFilter>>,
pub city: Option<Vec<StringFilter>>,
pub datacenter: Option<bool>,
pub residential: Option<bool>,
pub mobile: Option<bool>,
pub carrier: Option<Vec<StringFilter>>,
pub asn: Option<Vec<Asn>>,
}Expand description
Filter to select a specific kind of proxy.
If the id is specified the other fields are used
as a validator to see if the only possible matching proxy
matches these fields.
If the id is not specified, the other fields are used
to select a random proxy from the pool.
Filters can be combined to make combinations with special meaning.
E.g. datacenter:true, residential:true is essentially an ISP proxy.
§Usage
- Use
HeaderConfigLayer(rama-http) to have this proxy filter be given by the httpRequestheaders, which will add the extracted and parsedProxyFilterto theContext’sExtensions. - Or extract yourself from the username/token validated in the
ProxyAuthLayer(rama-http) to add it manually to theContext’sExtensions.
Fields§
§id: Option<NonEmptyString>The ID of the proxy to select.
pool_id: Option<Vec<StringFilter>>The ID of the pool from which to select the proxy.
continent: Option<Vec<StringFilter>>The continent of the proxy.
country: Option<Vec<StringFilter>>The country of the proxy.
state: Option<Vec<StringFilter>>The state of the proxy.
city: Option<Vec<StringFilter>>The city of the proxy.
datacenter: Option<bool>Set explicitly to true to select a datacenter proxy.
residential: Option<bool>Set explicitly to true to select a residential proxy.
mobile: Option<bool>Set explicitly to true to select a mobile proxy.
carrier: Option<Vec<StringFilter>>The mobile carrier desired.
asn: Option<Vec<Asn>>Autonomous System Number (ASN).
Trait Implementations§
§impl Clone for ProxyFilter
impl Clone for ProxyFilter
§fn clone(&self) -> ProxyFilter
fn clone(&self) -> ProxyFilter
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for ProxyFilter
impl Debug for ProxyFilter
§impl Default for ProxyFilter
impl Default for ProxyFilter
§fn default() -> ProxyFilter
fn default() -> ProxyFilter
§impl<'de> Deserialize<'de> for ProxyFilter
impl<'de> Deserialize<'de> for ProxyFilter
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProxyFilter, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ProxyFilter, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Hash for ProxyFilter
impl Hash for ProxyFilter
§impl PartialEq for ProxyFilter
impl PartialEq for ProxyFilter
§impl Serialize for ProxyFilter
impl Serialize for ProxyFilter
§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,
§impl<const SEPARATOR: char> UsernameLabelWriter<SEPARATOR> for ProxyFilter
impl<const SEPARATOR: char> UsernameLabelWriter<SEPARATOR> for ProxyFilter
§fn write_labels(
&self,
composer: &mut Composer<SEPARATOR>,
) -> Result<(), ComposeError>
fn write_labels( &self, composer: &mut Composer<SEPARATOR>, ) -> Result<(), ComposeError>
Composer.impl Eq for ProxyFilter
impl StructuralPartialEq for ProxyFilter
Auto Trait Implementations§
impl Freeze for ProxyFilter
impl RefUnwindSafe for ProxyFilter
impl Send for ProxyFilter
impl Sync for ProxyFilter
impl Unpin for ProxyFilter
impl UnwindSafe for ProxyFilter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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> 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