pub struct HttpProvider { /* private fields */ }Expand description
HTTP provider configuration
Implementations§
Source§impl HttpProvider
impl HttpProvider
Sourcepub fn new(name: impl Into<String>, url: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, url: impl Into<String>) -> Self
Create a new HTTP provider (plain text response)
Sourcepub fn with_parser(self, parser: ResponseParser) -> Self
pub fn with_parser(self, parser: ResponseParser) -> Self
Set custom response parser
Sourcepub fn with_v6_url(self, url: impl Into<String>) -> Self
pub fn with_v6_url(self, url: impl Into<String>) -> Self
Set IPv6 URL
Trait Implementations§
Source§impl Clone for HttpProvider
impl Clone for HttpProvider
Source§fn clone(&self) -> HttpProvider
fn clone(&self) -> HttpProvider
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HttpProvider
impl Debug for HttpProvider
Source§impl Provider for HttpProvider
impl Provider for HttpProvider
Source§fn supports_v4(&self) -> bool
fn supports_v4(&self) -> bool
Whether this provider supports IPv4
Source§fn supports_v6(&self) -> bool
fn supports_v6(&self) -> bool
Whether this provider supports IPv6
Source§fn get_ip(
&self,
version: IpVersion,
) -> Pin<Box<dyn Future<Output = Result<IpAddr, ProviderError>> + Send + '_>>
fn get_ip( &self, version: IpVersion, ) -> Pin<Box<dyn Future<Output = Result<IpAddr, ProviderError>> + Send + '_>>
Get the public IP address
Source§fn supports_version(&self, version: IpVersion) -> bool
fn supports_version(&self, version: IpVersion) -> bool
Check if provider supports the given IP version
Auto Trait Implementations§
impl Freeze for HttpProvider
impl !RefUnwindSafe for HttpProvider
impl Send for HttpProvider
impl Sync for HttpProvider
impl Unpin for HttpProvider
impl UnsafeUnpin for HttpProvider
impl !UnwindSafe for HttpProvider
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