Struct hyper::server::conn::AddrIncoming [−][src]
A stream of connections from binding to an address.
Implementations
impl AddrIncoming
[src]
pub fn bind(addr: &SocketAddr) -> Result<Self>
[src]
Creates a new AddrIncoming
binding to provided socket address.
pub fn local_addr(&self) -> SocketAddr
[src]
Get the local address bound to this listener.
pub fn set_keepalive(&mut self, keepalive: Option<Duration>) -> &mut Self
[src]
Set whether TCP keepalive messages are enabled on accepted connections.
If None
is specified, keepalive is disabled, otherwise the duration
specified will be the time to remain idle before sending TCP keepalive
probes.
pub fn set_nodelay(&mut self, enabled: bool) -> &mut Self
[src]
Set the value of TCP_NODELAY
option for accepted connections.
pub fn set_sleep_on_errors(&mut self, val: bool)
[src]
Set whether to sleep on accept errors.
A possible scenario is that the process has hit the max open files
allowed, and so trying to accept a new connection will fail with
EMFILE
. In some cases, it’s preferable to just wait for some time, if
the application will likely close some files (or connections), and try
to accept the connection again. If this option is true
, the error
will be logged at the error
level, since it is still a big deal,
and then the listener will sleep for 1 second.
In other cases, hitting the max open files should be treat similarly
to being out-of-memory, and simply error (and shutdown). Setting
this option to false
will allow that.
Default is true
.
Trait Implementations
impl Accept for AddrIncoming
[src]
type Conn = AddrStream
The connection type that can be accepted.
type Error = Error
The error type that can occur when accepting a connection.
fn poll_accept(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Conn, Self::Error>>>
[src]
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Conn, Self::Error>>>
impl Debug for AddrIncoming
[src]
Auto Trait Implementations
impl !RefUnwindSafe for AddrIncoming
impl Send for AddrIncoming
impl Sync for AddrIncoming
impl Unpin for AddrIncoming
impl !UnwindSafe for AddrIncoming
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> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
[src]
pub const ALIGN: usize
[src]
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
[src]
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
[src]
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
[src]
pub unsafe fn drop(ptr: usize)
[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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,