pub struct TargetName { /* private fields */ }
Expand description
A target name describes the TCP or Unix socket that a client will connect to.
Implementations§
Source§impl TargetName
impl TargetName
Sourcepub fn new_unix_path(path: impl AsRef<Path>) -> Result<Self, Error>
pub fn new_unix_path(path: impl AsRef<Path>) -> Result<Self, Error>
Create a new target for a Unix socket.
Sourcepub fn new_unix_domain(domain: impl AsRef<[u8]>) -> Result<Self, Error>
pub fn new_unix_domain(domain: impl AsRef<[u8]>) -> Result<Self, Error>
Create a new target for a Unix socket.
Sourcepub fn to_addrs_sync(&self) -> Result<Vec<ResolvedTarget>, Error>
pub fn to_addrs_sync(&self) -> Result<Vec<ResolvedTarget>, Error>
Resolves the target addresses for a given host.
Sourcepub fn port(&self) -> Option<u16>
pub fn port(&self) -> Option<u16>
Get the port of the target. If the target type does not include a port, this will return None.
Sourcepub fn try_set_port(&mut self, port: u16) -> Option<u16>
pub fn try_set_port(&mut self, port: u16) -> Option<u16>
Set the port of the target. If the target type does not include a port, this will return None. Otherwise, it will return the old port.
Sourcepub fn path(&self) -> Option<&Path>
pub fn path(&self) -> Option<&Path>
Get the path of the target. If the target type does not include a path, this will return None.
Sourcepub fn host(&self) -> Option<Cow<'_, str>>
pub fn host(&self) -> Option<Cow<'_, str>>
Get the host of the target. For resolved IP addresses, this is the string representation of the IP address. For unresolved hostnames, this is the hostname. If the target type does not include a host, this will return None.
Sourcepub fn name(&self) -> Option<ServerName<'_>>
pub fn name(&self) -> Option<ServerName<'_>>
Get the name of the target. For resolved IP addresses, this is the string representation of the IP address. For unresolved hostnames, this is the hostname.
Trait Implementations§
Source§impl Clone for TargetName
impl Clone for TargetName
Source§fn clone(&self) -> TargetName
fn clone(&self) -> TargetName
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read more