Enum uds::UnixSocketAddrRef [−][src]
An enum representation of an unix socket address.
Useful for pattern matching an UnixSocketAddr
via UnixSocketAddr.as_ref().
It cannot be used to bind or connect a socket directly as it
doesn't contain a sockaddr_un, but a UnixSocketAddr can be created
from it.
Examples
Cleaning up pathname socket files after ourselves:
let addr = UnixSocketAddr::from_path("/var/run/socket.sock").unwrap(); if let UnixSocketAddrRef::Path(path) = addr.as_ref() { let _ = std::fs::remove_file(path); }
Variants
Unnamed / anonymous address.
Path(&'a Path)Regular file path based address.
Can be both relative and absolute.
Address in the abstract namespace.
Trait Implementations
impl<'a> Clone for UnixSocketAddrRef<'a>[src]
fn clone(&self) -> UnixSocketAddrRef<'a>[src]
pub fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<'a> Copy for UnixSocketAddrRef<'a>[src]
impl<'a> Debug for UnixSocketAddrRef<'a>[src]
impl<'a> Eq for UnixSocketAddrRef<'a>[src]
impl<'a> From<&'a UnixSocketAddr> for UnixSocketAddrRef<'a>[src]
fn from(addr: &'a UnixSocketAddr) -> UnixSocketAddrRef<'a>[src]
impl<'a> Hash for UnixSocketAddrRef<'a>[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<'a> PartialEq<UnixSocketAddrRef<'a>> for UnixSocketAddrRef<'a>[src]
fn eq(&self, other: &UnixSocketAddrRef<'a>) -> bool[src]
fn ne(&self, other: &UnixSocketAddrRef<'a>) -> bool[src]
impl<'a> StructuralEq for UnixSocketAddrRef<'a>[src]
impl<'a> StructuralPartialEq for UnixSocketAddrRef<'a>[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for UnixSocketAddrRef<'a>[src]
impl<'a> Send for UnixSocketAddrRef<'a>[src]
impl<'a> Sync for UnixSocketAddrRef<'a>[src]
impl<'a> Unpin for UnixSocketAddrRef<'a>[src]
impl<'a> UnwindSafe for UnixSocketAddrRef<'a>[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, 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>,