#[non_exhaustive]pub enum SocketAddr {
Inet(SocketAddr),
Unix(SocketAddr),
}Expand description
Any address that Arti can listen on or connect to.
We use this type when we want to make streams without being concerned whether they are AF_UNIX streams, TCP streams, or so forth.
To avoid confusion, you might want to avoid importing this type directly.
Instead, import rtcompat::general
and refer to this type as general::SocketAddr.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Inet(SocketAddr)
An IPv4 or IPv6 address on the internet.
Unix(SocketAddr)
A local AF_UNIX address.
(Note that unix::SocketAddr is unconstructable on platforms where it is not supported.)
Trait Implementations§
source§impl Clone for SocketAddr
impl Clone for SocketAddr
source§fn clone(&self) -> SocketAddr
fn clone(&self) -> SocketAddr
Returns a copy of the value. Read more
1.6.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for SocketAddr
impl Debug for SocketAddr
source§impl From<SocketAddr> for SocketAddr
impl From<SocketAddr> for SocketAddr
source§fn from(value: SocketAddr) -> Self
fn from(value: SocketAddr) -> Self
Converts to this type from the input type.
source§impl From<SocketAddr> for SocketAddr
impl From<SocketAddr> for SocketAddr
source§fn from(value: SocketAddr) -> Self
fn from(value: SocketAddr) -> Self
Converts to this type from the input type.
source§impl NetStreamListener<SocketAddr> for Listener
impl NetStreamListener<SocketAddr> for Listener
source§type Stream = Stream
type Stream = Stream
The type of connections returned by
Self::incoming().source§type Incoming = IncomingStreams
type Incoming = IncomingStreams
The type of
stream::Stream returned by Self::incoming().source§fn incoming(self) -> IncomingStreams
fn incoming(self) -> IncomingStreams
Wrap this listener into a new
stream::Stream that yields
streams and addresses.source§fn local_addr(&self) -> IoResult<SocketAddr>
fn local_addr(&self) -> IoResult<SocketAddr>
Return the local address that this listener is bound to.
source§impl TryFrom<SocketAddr> for SocketAddr
impl TryFrom<SocketAddr> for SocketAddr
source§type Error = TryIntoError<SocketAddr>
type Error = TryIntoError<SocketAddr>
The type returned in the event of a conversion error.
source§impl TryFrom<SocketAddr> for SocketAddr
impl TryFrom<SocketAddr> for SocketAddr
source§type Error = TryIntoError<SocketAddr>
type Error = TryIntoError<SocketAddr>
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for SocketAddr
impl RefUnwindSafe for SocketAddr
impl Send for SocketAddr
impl Sync for SocketAddr
impl Unpin for SocketAddr
impl UnwindSafe for SocketAddr
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> NetStreamProvider<SocketAddr> for T
impl<T> NetStreamProvider<SocketAddr> for T
source§type Stream = Stream
type Stream = Stream
The type for the connections returned by
Self::connect().source§type Listener = Listener
type Listener = Listener
The type for the listeners returned by
Self::listen().source§fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 SocketAddr,
) -> Pin<Box<dyn Future<Output = Result<Stream, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
fn connect<'life0, 'life1, 'async_trait>(
&'life0 self,
addr: &'life1 SocketAddr,
) -> Pin<Box<dyn Future<Output = Result<Stream, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
T: 'async_trait,
Launch a connection connection to a given socket address. Read more