pub enum Addr {
Inet(SocketAddr),
Unix(PathBuf),
}
Expand description
Address of a Stream Endpoint
let addr: Addr = "127.0.0.1:1337".parse()?;
or (unix only):
let addr: Addr = "/tmp/uds_example".parse()?;
[FromStr::parse
] / Deserialize also resolves to the first IP Address if it does not start with /
or ./
.
Variants§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Addr
Available on crate feature serde
only.
impl<'de> Deserialize<'de> for Addr
Available on crate feature
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 Addr
impl From<SocketAddr> for Addr
Source§fn from(s: SocketAddr) -> Addr
fn from(s: SocketAddr) -> Addr
Converts to this type from the input type.
Source§impl From<SocketAddr> for Addr
impl From<SocketAddr> for Addr
Source§fn from(s: SocketAddr) -> Addr
fn from(s: SocketAddr) -> Addr
Converts to this type from the input type.
Source§impl From<SocketAddr> for Addr
impl From<SocketAddr> for Addr
Source§fn from(s: SocketAddr) -> Addr
fn from(s: SocketAddr) -> Addr
Converts to this type from the input type.
impl Eq for Addr
impl StructuralPartialEq for Addr
Auto Trait Implementations§
impl Freeze for Addr
impl RefUnwindSafe for Addr
impl Send for Addr
impl Sync for Addr
impl Unpin for Addr
impl UnwindSafe for Addr
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