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

pub struct WithListenLimits<Listener, Limits> {
    pub listener: Listener,
    // some fields omitted
}

A wrapper around a listening socket Fragment that adds limits and error handling to it.

There's also the convenience type alias WithLimits.

Note that the applied limits are per-instance. If there are two sockets in eg Vec<TcpListenWithLimits>, their limits are independent. In addition, if a configuration of a socket changes, the old listening socket is destroyed but the old connections are kept around until they terminate. The new listening socket starts with fresh limits, not counting the old connections.

Fields

listener: Listener

The inner listener socket.

This is available publicly to allow reading the extra configuration out of it.

Trait Implementations

impl<Listener: Clone, Limits: Clone> Clone for WithListenLimits<Listener, Limits>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<Listener: PartialEq, Limits: PartialEq> PartialEq<WithListenLimits<Listener, Limits>> for WithListenLimits<Listener, Limits>[src]

impl<Listener: PartialOrd, Limits: PartialOrd> PartialOrd<WithListenLimits<Listener, Limits>> for WithListenLimits<Listener, Limits>[src]

impl<Listener: Ord, Limits: Ord> Ord for WithListenLimits<Listener, Limits>[src]

fn max(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self
1.21.0
[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Returns max if self is greater than max, and min if self is less than min. Otherwise this will return self. Panics if min > max. Read more

impl<Listener: Eq, Limits: Eq> Eq for WithListenLimits<Listener, Limits>[src]

impl<Listener: Default, Limits: Default> Default for WithListenLimits<Listener, Limits>[src]

impl<Listener: Hash, Limits: Hash> Hash for WithListenLimits<Listener, Limits>[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl<Listener: Debug, Limits: Debug> Debug for WithListenLimits<Listener, Limits>[src]

impl<Listener, Limits> Serialize for WithListenLimits<Listener, Limits> where
    Listener: Serialize,
    Limits: Serialize
[src]

impl<'de, Listener, Limits> Deserialize<'de> for WithListenLimits<Listener, Limits> where
    Listener: Deserialize<'de>,
    Limits: Deserialize<'de>, 
[src]

impl<Listener, Limits> Comparable<WithListenLimits<Listener, Limits>> for WithListenLimits<Listener, Limits> where
    Listener: Comparable,
    Limits: PartialEq
[src]

impl<Listener, Limits> Fragment for WithListenLimits<Listener, Limits> where
    Listener: Clone + Debug + Fragment + Comparable,
    Limits: Clone + Debug + ListenLimits + PartialEq
[src]

type Driver = CacheSimilar<Self>

The default driver to be used by the fragment. Read more

type Installer = ()

The default installer to be used unless a transformation or the user doesn't provide one. Read more

type Seed = Listener::Seed

The intermediate product if the fragment supports two-stage creation of [Resource][Fragment::Resource]s. If not, it can be set to (). Read more

type Resource = LimitedListener<Listener::Resource>

The actual product this [Fragment] creates.

fn create(&self, name: &'static str) -> Result<Self::Resource, Error>[src]

Runs both stages of creation at once. Read more

impl<Listener, Limits> Stackable for WithListenLimits<Listener, Limits> where
    Listener: Stackable
[src]

impl<Listener, Limits> StructDoc for WithListenLimits<Listener, Limits> where
    Listener: StructDoc,
    Limits: StructDoc
[src]

Auto Trait Implementations

impl<Listener, Limits> Send for WithListenLimits<Listener, Limits> where
    Limits: Send,
    Listener: Send

impl<Listener, Limits> Sync for WithListenLimits<Listener, Limits> where
    Limits: Sync,
    Listener: Sync

Blanket Implementations

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

impl<T> From for T[src]

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

type Owned = T

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

The type returned in the event of a conversion error.

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

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

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

impl<T> IntoResult for T[src]

impl<F> Optional for F where
    F: Stackable
[src]

impl<T> Erased for T