pub struct Opts { /* private fields */ }Expand description
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§
Source§impl Opts
impl Opts
Sourcepub fn builder() -> OptsBuilder
pub fn builder() -> OptsBuilder
Constructs an OptsBuilder
Trait Implementations§
Source§impl From<OptsBuilder> for Opts
impl From<OptsBuilder> for Opts
Source§fn from(builder: OptsBuilder) -> Self
fn from(builder: OptsBuilder) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Opts
Auto Trait Implementations§
impl Freeze for Opts
impl RefUnwindSafe for Opts
impl Send for Opts
impl Sync for Opts
impl Unpin for Opts
impl UnwindSafe for Opts
Blanket Implementations§
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