[][src]Struct spirit_tokio::net::TcpListen

pub struct TcpListen<ExtraCfg = Empty, TcpStreamConfigure = TcpConfig> {
    pub extra_cfg: ExtraCfg,
    // some fields omitted
}

A configuration fragment of a TCP listening socket.

The Fragment creates a TcpListener (wrapped in ConfiguredIncoming). It can be handled directly, or through Pipelines and handlers.

Note that this stream sometimes returns errors „in the middle“, but most stream consumers terminate on the first error. You might be interested in the WithListenLimits wrapper to handle that automatically (or, see the TcpListenWithLimits for a convenient type alias).

Type parametes

  • ExtraCfg: Additional application specific configuration that can be extracted and used by the application code. This doesn't influence the socket created in any way.
  • TcpStreamConfigure: Further configuration for the accepted TCP streams in the form of StreamConfig

Fields

The configuration fields are pooled from all three type parameters above and from the Listen configuration fragment.

Fields

extra_cfg: ExtraCfg

Arbitrary application specific configuration that doesn't influence the sockets created.

Trait Implementations

impl<ExtraCfg: Clone, TcpStreamConfigure: Clone> Clone for TcpListen<ExtraCfg, TcpStreamConfigure>[src]

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

Performs copy-assignment from source. Read more

impl<ExtraCfg: PartialEq, TcpStreamConfigure: PartialEq> PartialEq<TcpListen<ExtraCfg, TcpStreamConfigure>> for TcpListen<ExtraCfg, TcpStreamConfigure>[src]

impl<ExtraCfg: PartialOrd, TcpStreamConfigure: PartialOrd> PartialOrd<TcpListen<ExtraCfg, TcpStreamConfigure>> for TcpListen<ExtraCfg, TcpStreamConfigure>[src]

impl<ExtraCfg: Ord, TcpStreamConfigure: Ord> Ord for TcpListen<ExtraCfg, TcpStreamConfigure>[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<ExtraCfg: Eq, TcpStreamConfigure: Eq> Eq for TcpListen<ExtraCfg, TcpStreamConfigure>[src]

impl<ExtraCfg: Default, TcpStreamConfigure: Default> Default for TcpListen<ExtraCfg, TcpStreamConfigure>[src]

impl<ExtraCfg: Hash, TcpStreamConfigure: Hash> Hash for TcpListen<ExtraCfg, TcpStreamConfigure>[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<ExtraCfg: Debug, TcpStreamConfigure: Debug> Debug for TcpListen<ExtraCfg, TcpStreamConfigure>[src]

impl<ExtraCfg, TcpStreamConfigure> Serialize for TcpListen<ExtraCfg, TcpStreamConfigure> where
    ExtraCfg: Serialize,
    TcpStreamConfigure: Serialize
[src]

impl<'de, ExtraCfg, TcpStreamConfigure> Deserialize<'de> for TcpListen<ExtraCfg, TcpStreamConfigure> where
    ExtraCfg: Deserialize<'de>,
    TcpStreamConfigure: Deserialize<'de>, 
[src]

impl<ExtraCfg: PartialEq, TcpConfig: PartialEq> Comparable<TcpListen<ExtraCfg, TcpConfig>> for TcpListen<ExtraCfg, TcpConfig>[src]

impl<ExtraCfg, TcpConfig> Fragment for TcpListen<ExtraCfg, TcpConfig> where
    ExtraCfg: Clone + Debug + PartialEq,
    TcpConfig: Clone + Debug + 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 = StdTcpListener

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 = ConfiguredStreamListener<TcpListener, TcpConfig>

The actual product this [Fragment] creates.

const RUN_BEFORE_CONFIG: bool[src]

Configuration if the pipeline should be run once even before the config is loaded. Read more

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

Runs both stages of creation at once. Read more

fn init<B>(builder: B, &'static str) -> Result<B, Error> where
    B: Extensible<Ok = B>,
    <B as Extensible>::Config: DeserializeOwned,
    <B as Extensible>::Config: Send,
    <B as Extensible>::Config: Sync,
    <B as Extensible>::Config: 'static,
    <B as Extensible>::Opts: StructOpt,
    <B as Extensible>::Opts: Send,
    <B as Extensible>::Opts: Sync,
    <B as Extensible>::Opts: 'static, 
[src]

An initialization routine. Read more

impl<ExtraCfg, TcpConfig> Stackable for TcpListen<ExtraCfg, TcpConfig>[src]

impl<ExtraCfg, TcpStreamConfigure> StructDoc for TcpListen<ExtraCfg, TcpStreamConfigure> where
    ExtraCfg: StructDoc,
    TcpStreamConfigure: StructDoc
[src]

Auto Trait Implementations

impl<ExtraCfg, TcpStreamConfigure> Send for TcpListen<ExtraCfg, TcpStreamConfigure> where
    ExtraCfg: Send,
    TcpStreamConfigure: Send

impl<ExtraCfg, TcpStreamConfigure> Sync for TcpListen<ExtraCfg, TcpStreamConfigure> where
    ExtraCfg: Sync,
    TcpStreamConfigure: 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