Struct lead_oxide::opts::Opts[][src]

pub struct Opts { /* fields omitted */ }

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]

impl PartialEq<Opts> for Opts[src]

impl Serialize for Opts[src]

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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.