pub struct UniAddr { /* private fields */ }Expand description
A unified address type that can represent:
std::net::SocketAddrunix::SocketAddr(a wrapper overstd::os::unix::net::SocketAddr)- A host name with port. See [
ToSocketAddrs].
§Parsing Behaviour
- Checks if the address started with
UNIX_URI_PREFIX: parse as a UDS address. - Checks if the address is started with a alphabetic character (a-z, A-Z): treat as a host name. Notes that we will not validate if the host name is valid.
- Tries to parse as a network socket address.
- Otherwise, treats the input as a host name.
Implementations§
Trait Implementations§
Source§impl AsRef<UniAddrInner> for UniAddr
impl AsRef<UniAddrInner> for UniAddr
Source§fn as_ref(&self) -> &UniAddrInner
fn as_ref(&self) -> &UniAddrInner
Converts this type into a shared reference of the (usually inferred) input type.
Source§impl<'de> Deserialize<'de> for UniAddr
Available on crate feature feat-serde only.
impl<'de> Deserialize<'de> for UniAddr
Available on crate feature
feat-serde only.Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<SocketAddr> for UniAddr
impl From<SocketAddr> for UniAddr
Source§fn from(addr: SocketAddr) -> Self
fn from(addr: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for UniAddr
Available on Unix only.
impl From<SocketAddr> for UniAddr
Available on Unix only.
Source§fn from(addr: SocketAddr) -> Self
fn from(addr: SocketAddr) -> Self
Converts to this type from the input type.
Source§impl From<SocketAddr> for UniAddr
Available on Unix and crate feature feat-tokio only.
impl From<SocketAddr> for UniAddr
Available on Unix and crate feature
feat-tokio only.Source§fn from(addr: SocketAddr) -> Self
fn from(addr: SocketAddr) -> Self
Converts to this type from the input type.
impl Eq for UniAddr
impl StructuralPartialEq for UniAddr
Auto Trait Implementations§
impl Freeze for UniAddr
impl RefUnwindSafe for UniAddr
impl Send for UniAddr
impl Sync for UniAddr
impl Unpin for UniAddr
impl UnwindSafe for UniAddr
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