[][src]Struct spirit_tokio::net::limits::Limits

#[non_exhaustive]pub struct Limits {
    pub error_sleep: Duration,
    pub max_conn: Option<usize>,
}

An implementation of ListenLimits that reads the limits from configuration.

Fields

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
error_sleep: Duration

How long to wait before trying again after an error.

Some errors when accepting are simply ignored (eg. the connection was closed by the other side before we had time to accept it). Some others (eg. too many open files) put the acceptor into a sleep before it tries again, in the hope the situation will have improved by then.

Defaults to 100ms if not set.

max_conn: Option<usize>

Maximum number of connections per one listener.

If it is reached, more connections will not be accepted until some of the old ones are terminated.

Defaults to implementation limits if not set (2^31 - 1 on 32bit systems, 2^63 - 1 on 64bit systems), which is likely higher than what the OS can effectively handle ‒ so you can assume that if not set, there's no limit.

Trait Implementations

impl Clone for Limits[src]

impl Debug for Limits[src]

impl Default for Limits[src]

impl<'de> Deserialize<'de> for Limits[src]

impl Eq for Limits[src]

impl Hash for Limits[src]

impl ListenLimits for Limits[src]

impl Ord for Limits[src]

impl PartialEq<Limits> for Limits[src]

impl PartialOrd<Limits> for Limits[src]

impl Serialize for Limits[src]

impl StructDoc for Limits[src]

impl StructuralEq for Limits[src]

impl StructuralPartialEq for Limits[src]

Auto Trait Implementations

impl RefUnwindSafe for Limits

impl Send for Limits

impl Sync for Limits

impl Unpin for Limits

impl UnwindSafe for Limits

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoResult<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.