Struct quilkin::net::DualStackLocalSocket
source · pub struct DualStackLocalSocket { /* private fields */ }
Expand description
An ipv6 socket that can accept and send data from either a local ipv4 address or ipv6 address with port reuse enabled and only_v6 set to false.
Implementations§
source§impl DualStackLocalSocket
impl DualStackLocalSocket
pub fn from_raw(socket: Socket) -> Self
pub fn new(port: u16) -> Result<Self>
pub fn bind_local(port: u16) -> Result<Self>
pub fn local_ipv4_addr(&self) -> Result<SocketAddr>
pub fn local_ipv6_addr(&self) -> Result<SocketAddr>
pub async fn recv_from<B: IoBufMut>( &self, buf: B ) -> (Result<(usize, SocketAddr)>, B)
pub async fn send_to<B: IoBuf>( &self, buf: B, target: SocketAddr ) -> (Result<usize>, B)
pub fn make_refcnt(self) -> DualStackLocalSocketRc
Auto Trait Implementations§
impl !RefUnwindSafe for DualStackLocalSocket
impl !Send for DualStackLocalSocket
impl !Sync for DualStackLocalSocket
impl Unpin for DualStackLocalSocket
impl !UnwindSafe for DualStackLocalSocket
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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<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::Request