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,
}
Expand description
A configuration fragment of a TCP listening socket.
The Fragment
creates a TcpListener
(wrapped in ConfiguredListener
). It can be
handled directly, or through Pipeline
s.
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 ofStreamConfig
Fields
The configuration fields are pooled from all three type parameters above and from the
Listen
configuration fragment.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
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
Compares two fragments.
impl<'de, ExtraCfg, TcpStreamConfigure> Deserialize<'de> for TcpListen<ExtraCfg, TcpStreamConfigure> where
ExtraCfg: Deserialize<'de>,
TcpStreamConfigure: Deserialize<'de>,
impl<'de, ExtraCfg, TcpStreamConfigure> Deserialize<'de> for TcpListen<ExtraCfg, TcpStreamConfigure> where
ExtraCfg: Deserialize<'de>,
TcpStreamConfigure: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
type Driver = CacheSimilar<Self>
type Driver = CacheSimilar<Self>
The default driver to be used by the fragment. Read more
The default installer to be used unless a transformation or the user doesn’t provide one. Read more
type Seed = StdTcpListener
type Seed = StdTcpListener
type Resource = ConfiguredListener<TcpListener, TcpConfig>
type Resource = ConfiguredListener<TcpListener, TcpConfig>
The actual product this Fragment
creates.
Runs the first stage of creation. Read more
Runs the second stage of creation. Read more
Configuration if the pipeline should be run once even before the config is loaded. Read more
Runs both stages of creation at once. Read more
fn init<B>(
builder: B,
&'static str
) -> Result<B, Box<dyn Error + Send + Sync + 'static, Global>> where
B: Extensible<Ok = B>,
<B as Extensible>::Config: 'static,
<B as Extensible>::Config: DeserializeOwned,
<B as Extensible>::Config: Send,
<B as Extensible>::Config: Sync,
<B as Extensible>::Opts: 'static,
<B as Extensible>::Opts: StructOpt,
<B as Extensible>::Opts: Send,
<B as Extensible>::Opts: Sync,
fn init<B>(
builder: B,
&'static str
) -> Result<B, Box<dyn Error + Send + Sync + 'static, Global>> where
B: Extensible<Ok = B>,
<B as Extensible>::Config: 'static,
<B as Extensible>::Config: DeserializeOwned,
<B as Extensible>::Config: Send,
<B as Extensible>::Config: Sync,
<B as Extensible>::Opts: 'static,
<B as Extensible>::Opts: StructOpt,
<B as Extensible>::Opts: Send,
<B as Extensible>::Opts: Sync,
An initialization routine. Read more
impl<ExtraCfg: PartialOrd, TcpStreamConfigure: PartialOrd> PartialOrd<TcpListen<ExtraCfg, TcpStreamConfigure>> for TcpListen<ExtraCfg, TcpStreamConfigure>
impl<ExtraCfg: PartialOrd, TcpStreamConfigure: PartialOrd> PartialOrd<TcpListen<ExtraCfg, TcpStreamConfigure>> for TcpListen<ExtraCfg, TcpStreamConfigure>
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Returns the documentation for the type. Read more
impl<ExtraCfg, TcpStreamConfigure> StructuralPartialEq for TcpListen<ExtraCfg, TcpStreamConfigure>
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
Mutably borrows from an owned value. Read more