Struct isahc::config::Dialer [−][src]
A custom address or dialer for connecting to a host.
A dialer can be created from a URI-like string using FromStr
. The
following URI schemes are supported:
tcp
: Connect to a TCP address and port pair, liketcp:127.0.0.1:8080
.unix
: Connect to a Unix socket located on the file system, likeunix:/path/to/my.sock
. This is only supported on Unix.
The Default
dialer uses the hostname and port specified in each request
as normal.
Examples
Connect to a Unix socket URI:
use isahc::config::Dialer; let unix_socket = "unix:/path/to/my.sock".parse::<Dialer>()?;
Implementations
impl Dialer
[src]
pub fn ip_socket(addr: impl Into<SocketAddr>) -> Self
[src]
Connect to the given IP socket.
Any value that can be converted into a SocketAddr
can be given as an
argument; check the SocketAddr
documentation for a complete list.
Examples
use isahc::config::Dialer; use std::net::Ipv4Addr; let dialer = Dialer::ip_socket((Ipv4Addr::LOCALHOST, 8080));
use isahc::config::Dialer; use std::net::SocketAddr; let dialer = Dialer::ip_socket("0.0.0.0:8765".parse::<SocketAddr>()?);
pub fn unix_socket(path: impl Into<PathBuf>) -> Self
[src]
Connect to a Unix socket described by a file.
The path given is not checked ahead of time for correctness or that the socket exists. If the socket is invalid an error will be returned when a request attempt is made.
Examples
use isahc::config::Dialer; let docker = Dialer::unix_socket("/var/run/docker.sock");
Availability
This function is only available on Unix.
Trait Implementations
impl Clone for Dialer
[src]
impl Debug for Dialer
[src]
impl Default for Dialer
[src]
impl From<SocketAddr> for Dialer
[src]
fn from(socket_addr: SocketAddr) -> Self
[src]
impl FromStr for Dialer
[src]
type Err = DialerParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl TryFrom<&'_ str> for Dialer
[src]
type Error = DialerParseError
The type returned in the event of a conversion error.
fn try_from(str: &str) -> Result<Self, Self::Error>
[src]
impl TryFrom<String> for Dialer
[src]
type Error = DialerParseError
The type returned in the event of a conversion error.
fn try_from(string: String) -> Result<Self, Self::Error>
[src]
impl TryFrom<Uri> for Dialer
[src]
Auto Trait Implementations
impl RefUnwindSafe for Dialer
[src]
impl Send for Dialer
[src]
impl Sync for Dialer
[src]
impl Unpin for Dialer
[src]
impl UnwindSafe for Dialer
[src]
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> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,