Struct sn0int_std::web::Client
source · pub struct Client<R>where
R: DnsResolver,{ /* private fields */ }
Expand description
A Client to make outgoing HTTP requests.
Uses an specific DNS resolver.
Implementations§
source§impl<R> Client<R>where
R: DnsResolver + 'static,
impl<R> Client<R>where R: DnsResolver + 'static,
sourcepub fn new(resolver: R) -> Client<R>
pub fn new(resolver: R) -> Client<R>
Create a new client with a specific DNS resolver.
This bypasses /etc/resolv.conf
.
sourcepub fn get(&self, url: &str) -> ResponseFuture
pub fn get(&self, url: &str) -> ResponseFuture
Shorthand function to do a GET request with HttpClient::request
.
source§impl Client<Resolver>
impl Client<Resolver>
sourcepub fn with_system_resolver() -> Result<Client<Resolver>, Error>
pub fn with_system_resolver() -> Result<Client<Resolver>, Error>
Create a new client with the system resolver from /etc/resolv.conf
.
sourcepub fn with_system_resolver_v4() -> Result<Client<Resolver>, Error>
pub fn with_system_resolver_v4() -> Result<Client<Resolver>, Error>
Create a new client with the ipv4 system resolver from /etc/resolv.conf
.
sourcepub fn with_socks5(proxy: SocketAddr) -> Client<Resolver>
pub fn with_socks5(proxy: SocketAddr) -> Client<Resolver>
Create a new client that is locked to a socks5 proxy
Trait Implementations§
source§impl<R> HttpClient for Client<R>where
R: DnsResolver + 'static,
impl<R> HttpClient for Client<R>where R: DnsResolver + 'static,
Auto Trait Implementations§
impl<R> !RefUnwindSafe for Client<R>
impl<R> Send for Client<R>
impl<R> Sync for Client<R>
impl<R> Unpin for Client<R>
impl<R> !UnwindSafe for Client<R>
Blanket Implementations§
§impl<'a, T> AsTaggedExplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedExplicit<'a> for Twhere T: 'a,
§impl<'a, T> AsTaggedImplicit<'a> for Twhere
T: 'a,
impl<'a, T> AsTaggedImplicit<'a> 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