Struct lead_oxide::opts::Opts [−][src]
A set of options to constrain the returned proxies.
Opts
represents all the filtering options that are passed on to the API by the corresponding
Fetcher
. By default no values are filtered and any kind of proxy
can be returned so this list of options only serves to restrict the proxies returned. The
typical way to construct Opts
is with OptsBuilder
with the entrypoint of
Opts::builder()
.
use iso_country::Country; use lead_oxide::{ opts::Opts, types::{Countries, LastChecked, Level, Protocol, TimeToConnect} }; use std::{convert::TryFrom, num::NonZeroU16, time::Duration}; let basic_opts = Opts::builder() .post(true) .cookies(true) .build(); let kitchen_sink = Opts::builder() .api_key("<key>".to_string()) .level(Level::Elite) .protocol(Protocol::Socks4) .countries(Countries::block().countries(&[Country::CH, Country::ES])) .last_checked(LastChecked::try_from(Duration::from_secs(60 * 10)).unwrap()) .time_to_connect(TimeToConnect::try_from(Duration::from_secs(10)).unwrap()) .port(NonZeroU16::new(8080).unwrap()) .cookies(true) .connects_to_google(false) .https(true) .post(false) .referer(true) .forwards_user_agent(false) .build();
Implementations
impl Opts
[src]
pub fn builder() -> OptsBuilder
[src]
Constructs an OptsBuilder
Trait Implementations
impl Clone for Opts
[src]
impl Debug for Opts
[src]
impl Default for Opts
[src]
impl From<OptsBuilder> for Opts
[src]
fn from(builder: OptsBuilder) -> Self
[src]
impl PartialEq<Opts> for Opts
[src]
impl Serialize for Opts
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Opts
[src]
Auto Trait Implementations
impl RefUnwindSafe for Opts
impl Send for Opts
impl Sync for Opts
impl Unpin for Opts
impl UnwindSafe for Opts
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,