Struct Proxy
pub struct Proxy {Show 18 fields
pub id: NonEmptyString,
pub address: ProxyAddress,
pub tcp: bool,
pub udp: bool,
pub http: bool,
pub https: bool,
pub socks5: bool,
pub socks5h: bool,
pub datacenter: bool,
pub residential: bool,
pub mobile: bool,
pub pool_id: Option<StringFilter>,
pub continent: Option<StringFilter>,
pub country: Option<StringFilter>,
pub state: Option<StringFilter>,
pub city: Option<StringFilter>,
pub carrier: Option<StringFilter>,
pub asn: Option<Asn>,
}
Expand description
The selected proxy to use to connect to the proxy.
Fields§
§id: NonEmptyString
Unique identifier of the proxy.
address: ProxyAddress
The address to be used to connect to the proxy, including credentials if needed.
tcp: bool
True if the proxy supports TCP connections.
udp: bool
True if the proxy supports UDP connections.
http: bool
http-proxy enabled
https: bool
https-proxy enabled
socks5: bool
socks5-proxy enabled
socks5h: bool
socks5h-proxy enabled
datacenter: bool
Proxy is located in a datacenter.
residential: bool
Proxy’s IP is labeled as residential.
mobile: bool
Proxy’s IP originates from a mobile network.
pool_id: Option<StringFilter>
Pool ID of the proxy.
continent: Option<StringFilter>
Continent of the proxy.
country: Option<StringFilter>
Country of the proxy.
state: Option<StringFilter>
State of the proxy.
city: Option<StringFilter>
City of the proxy.
carrier: Option<StringFilter>
Mobile carrier of the proxy.
asn: Option<Asn>
Autonomous System Number (ASN).
Implementations§
§impl Proxy
impl Proxy
pub fn is_match(&self, ctx: &ProxyContext, filter: &ProxyFilter) -> bool
pub fn is_match(&self, ctx: &ProxyContext, filter: &ProxyFilter) -> bool
Check if the proxy is a match for the givenProxyContext
and ProxyFilter
.
Trait Implementations§
§impl<'de> Deserialize<'de> for Proxy
impl<'de> Deserialize<'de> for Proxy
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Proxy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Proxy, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl ProxyDB for Proxy
impl ProxyDB for Proxy
§type Error = OpaqueError
type Error = OpaqueError
The error type that can be returned by the proxy database Read more
§async fn get_proxy_if(
&self,
ctx: ProxyContext,
filter: ProxyFilter,
predicate: impl ProxyQueryPredicate,
) -> Result<Proxy, <Proxy as ProxyDB>::Error>
async fn get_proxy_if( &self, ctx: ProxyContext, filter: ProxyFilter, predicate: impl ProxyQueryPredicate, ) -> Result<Proxy, <Proxy as ProxyDB>::Error>
Same as
Self::get_proxy
but with a predicate
to filter out found proxies that do not match the given predicate.§fn get_proxy(
&self,
ctx: ProxyContext,
filter: ProxyFilter,
) -> impl Future<Output = Result<Proxy, Self::Error>> + Send
fn get_proxy( &self, ctx: ProxyContext, filter: ProxyFilter, ) -> impl Future<Output = Result<Proxy, Self::Error>> + Send
Get a
Proxy
based on the given ProxyContext
and ProxyFilter
,
or return an error in case no Proxy
could be returned.§impl Serialize for Proxy
impl Serialize for Proxy
§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 Freeze for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnwindSafe for Proxy
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
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> ⓘ
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> 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