Enum tiny_http::ListenAddr
source · [−]pub enum ListenAddr {
IP(SocketAddr),
Unix(SocketAddr),
}
Expand description
Unified listen socket address. Either a SocketAddr
or std::os::unix::net::SocketAddr
.
Variants
IP(SocketAddr)
Unix(SocketAddr)
Implementations
sourceimpl ListenAddr
impl ListenAddr
pub fn to_ip(self) -> Option<SocketAddr>
sourcepub fn to_unix(self) -> Option<SocketAddr>
pub fn to_unix(self) -> Option<SocketAddr>
Gets the Unix socket address.
This is also available on non-Unix platforms, for ease of use, but always returns None
.
Trait Implementations
sourceimpl Clone for ListenAddr
impl Clone for ListenAddr
sourcefn clone(&self) -> ListenAddr
fn clone(&self) -> ListenAddr
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for ListenAddr
impl Debug for ListenAddr
sourceimpl Display for ListenAddr
impl Display for ListenAddr
sourceimpl From<SocketAddr> for ListenAddr
impl From<SocketAddr> for ListenAddr
sourcefn from(s: SocketAddr) -> Self
fn from(s: SocketAddr) -> Self
Converts to this type from the input type.
sourceimpl From<SocketAddr> for ListenAddr
impl From<SocketAddr> for ListenAddr
sourcefn from(s: SocketAddr) -> Self
fn from(s: SocketAddr) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl RefUnwindSafe for ListenAddr
impl Send for ListenAddr
impl Sync for ListenAddr
impl Unpin for ListenAddr
impl UnwindSafe for ListenAddr
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more