#[non_exhaustive]pub enum SocketAddr {
Unknown,
IPv4(SocketAddrV4),
IPv6(SocketAddrV6),
Unix(Arc<SocketAddr>),
}Expand description
Network socket address
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.
Unknown
Unknown address
IPv4(SocketAddrV4)
IPv4 socket address
IPv6(SocketAddrV6)
IPv6 socket address
Unix(Arc<SocketAddr>)
Unix socket address
Implementations§
Source§impl SocketAddr
impl SocketAddr
Sourcepub fn into_std(self) -> Option<SocketAddr>
pub fn into_std(self) -> Option<SocketAddr>
Convert to std::net::SocketAddr.
Sourcepub fn as_ipv6(&self) -> Option<&SocketAddrV6>
pub fn as_ipv6(&self) -> Option<&SocketAddrV6>
Returns IPv6 socket address.
Sourcepub fn as_ipv4(&self) -> Option<&SocketAddrV4>
pub fn as_ipv4(&self) -> Option<&SocketAddrV4>
Returns IPv4 socket address.
Sourcepub fn as_unix(&self) -> Option<&SocketAddr>
pub fn as_unix(&self) -> Option<&SocketAddr>
Returns Unix socket address.
Trait Implementations§
Source§impl Clone for SocketAddr
impl Clone for SocketAddr
Source§fn clone(&self) -> SocketAddr
fn clone(&self) -> SocketAddr
Returns a duplicate of the value. Read more
1.0.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 Display for SocketAddr
impl Display for SocketAddr
Source§impl From<Arc<SocketAddr>> for SocketAddr
impl From<Arc<SocketAddr>> for SocketAddr
Source§fn from(addr: Arc<SocketAddr>) -> SocketAddr
fn from(addr: Arc<SocketAddr>) -> SocketAddr
Converts to this type from the input type.
Source§impl From<SocketAddr> for SocketAddr
impl From<SocketAddr> for SocketAddr
Source§fn from(addr: SocketAddr) -> SocketAddr
fn from(addr: SocketAddr) -> SocketAddr
Converts to this type from the input type.
Source§impl From<SocketAddr> for SocketAddr
impl From<SocketAddr> for SocketAddr
Source§fn from(addr: SocketAddr) -> SocketAddr
fn from(addr: SocketAddr) -> SocketAddr
Converts to this type from the input type.
Source§impl From<SocketAddrV4> for SocketAddr
impl From<SocketAddrV4> for SocketAddr
Source§fn from(addr: SocketAddrV4) -> SocketAddr
fn from(addr: SocketAddrV4) -> SocketAddr
Converts to this type from the input type.
Source§impl From<SocketAddrV6> for SocketAddr
impl From<SocketAddrV6> for SocketAddr
Source§fn from(addr: SocketAddrV6) -> SocketAddr
fn from(addr: SocketAddrV6) -> SocketAddr
Converts to this type from the input type.
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<Data> ApiSuccessResponse for Data
impl<Data> ApiSuccessResponse for Data
fn api_response<Meta>(self, meta: Option<Meta>) -> ApiResponse<Self, Meta>
fn api_response_without_meta<Meta>(self) -> ApiResponse<Self, Meta>
fn api_response_with_meta<Meta>(self, meta: Meta) -> ApiResponse<Self, Meta>
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§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> FutureTraceExt for Twhere
T: FutureExt,
impl<T> FutureTraceExt for Twhere
T: FutureExt,
Source§fn with_current_context_span(self, otel_span: Span) -> WithContext<Self> ⓘ
fn with_current_context_span(self, otel_span: Span) -> WithContext<Self> ⓘ
Pass the span of opentelemetry to the current context of tracing.
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<E> IntoError for E
impl<E> IntoError for E
fn into_error(self) -> ErrWrapper<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::RequestSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more