Struct TcpListenerBuilder
pub struct TcpListenerBuilder { /* private fields */ }
Expand description
Builder for TcpListener
.
Implementations§
§impl TcpListenerBuilder
impl TcpListenerBuilder
pub fn new() -> TcpListenerBuilder
pub fn new() -> TcpListenerBuilder
Create a new TcpListenerBuilder
without a state.
§impl TcpListenerBuilder
impl TcpListenerBuilder
pub fn with_ttl(self, ttl: u32) -> TcpListenerBuilder
pub fn with_ttl(self, ttl: u32) -> TcpListenerBuilder
Sets the value for the IP_TTL
option on this socket.
This value sets the time-to-live field that is used in every packet sent from this socket.
pub fn set_ttl(&mut self, ttl: u32) -> &mut TcpListenerBuilder
pub fn set_ttl(&mut self, ttl: u32) -> &mut TcpListenerBuilder
Sets the value for the IP_TTL
option on this socket.
This value sets the time-to-live field that is used in every packet sent from this socket.
§impl TcpListenerBuilder
impl TcpListenerBuilder
pub async fn bind_address<A>(
self,
addr: A,
) -> Result<TcpListener, Box<dyn Error + Sync + Send>>where
A: TryInto<SocketAddress>,
<A as TryInto<SocketAddress>>::Error: Into<Box<dyn Error + Sync + Send>>,
pub async fn bind_address<A>(
self,
addr: A,
) -> Result<TcpListener, Box<dyn Error + Sync + Send>>where
A: TryInto<SocketAddress>,
<A as TryInto<SocketAddress>>::Error: Into<Box<dyn Error + Sync + Send>>,
Creates a new TcpListener, which will be bound to the specified socket address.
The returned listener is ready for accepting connections.
Binding with a port number of 0 will request that the OS assigns a port
to this listener. The port allocated can be queried via the local_addr
method.
pub async fn bind_socket(
self,
socket: Socket,
) -> Result<TcpListener, Box<dyn Error + Sync + Send>>
pub async fn bind_socket( self, socket: Socket, ) -> Result<TcpListener, Box<dyn Error + Sync + Send>>
Creates a new TcpListener, which will be bound to the specified socket.
The returned listener is ready for accepting connections.
pub async fn bind_device<N>(
self,
name: N,
) -> Result<TcpListener, Box<dyn Error + Sync + Send>>
pub async fn bind_device<N>( self, name: N, ) -> Result<TcpListener, Box<dyn Error + Sync + Send>>
Creates a new TcpListener, which will be bound to the specified (interface) device name).
The returned listener is ready for accepting connections.
Trait Implementations§
§impl Clone for TcpListenerBuilder
impl Clone for TcpListenerBuilder
§fn clone(&self) -> TcpListenerBuilder
fn clone(&self) -> TcpListenerBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl Debug for TcpListenerBuilder
impl Debug for TcpListenerBuilder
§impl Default for TcpListenerBuilder
impl Default for TcpListenerBuilder
§fn default() -> TcpListenerBuilder
fn default() -> TcpListenerBuilder
Auto Trait Implementations§
impl Freeze for TcpListenerBuilder
impl RefUnwindSafe for TcpListenerBuilder
impl Send for TcpListenerBuilder
impl Sync for TcpListenerBuilder
impl Unpin for TcpListenerBuilder
impl UnwindSafe for TcpListenerBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§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> 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> ⓘ
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> ⓘ
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more