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 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)

This struct is marked as 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

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Compares two fragments.

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Deserialize this value from the given Serde deserializer. Read more

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

The intermediate product if the fragment supports two-stage creation of Resources. If not, it can be set to (). Read more

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

An initialization routine. Read more

Feeds this value into the given Hasher. Read more

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

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

Returns the documentation for the type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Turns self into the result.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

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

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.