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

#[non_exhaustive]pub struct TcpListen<ExtraCfg = Empty, TcpStreamConfigure = TcpConfig> {
    pub listen: Listen,
    pub tcp_config: TcpStreamConfigure,
    pub extra_cfg: ExtraCfg,
}

A configuration fragment of a TCP listening socket.

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

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 (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.
listen: Listen

The actual listener socket address.

tcp_config: TcpStreamConfigure

Configuration to be applied to the accepted connections.

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]

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

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

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

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

impl<ExtraCfg: Eq, TcpStreamConfigure: Eq> Eq for TcpListen<ExtraCfg, TcpStreamConfigure>[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 Resources. If not, it can be set to (). Read more

type Resource = ConfiguredListener<TcpListener, TcpConfig>

The actual product this Fragment creates.

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

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

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, TcpStreamConfigure> Serialize for TcpListen<ExtraCfg, TcpStreamConfigure> where
    ExtraCfg: Serialize,
    TcpStreamConfigure: Serialize
[src]

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

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

impl<ExtraCfg, TcpStreamConfigure> StructuralEq for TcpListen<ExtraCfg, TcpStreamConfigure>[src]

impl<ExtraCfg, TcpStreamConfigure> StructuralPartialEq for TcpListen<ExtraCfg, TcpStreamConfigure>[src]

Auto Trait Implementations

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

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

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

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

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<F> Optional for F where
    F: Stackable
[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.