[−][src]Struct spirit_tokio::net::TcpListen
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 ofStreamConfig
Fields
The configuration fields are pooled from all three type parameters above and from the
Listen configuration fragment.
Fields (Non-exhaustive)
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.listen: ListenThe actual listener socket address.
tcp_config: TcpStreamConfigureConfiguration to be applied to the accepted connections.
extra_cfg: ExtraCfgArbitrary 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(&self) -> TcpListen<ExtraCfg, TcpStreamConfigure>[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
impl<ExtraCfg: PartialEq, TcpConfig: PartialEq> Comparable<TcpListen<ExtraCfg, TcpConfig>> for TcpListen<ExtraCfg, TcpConfig>[src]
fn compare(&self, other: &Self) -> Comparison[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]
ExtraCfg: Deserialize<'de>,
TcpStreamConfigure: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>, [src]
__D: Deserializer<'de>,
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]
ExtraCfg: Clone + Debug + PartialEq,
TcpConfig: Clone + Debug + PartialEq,
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.
fn make_seed(&self, name: &str) -> Result<StdTcpListener, AnyError>[src]
fn make_resource(
&self,
seed: &mut Self::Seed,
name: &str
) -> Result<Self::Resource, AnyError>[src]
&self,
seed: &mut Self::Seed,
name: &str
) -> Result<Self::Resource, AnyError>
const RUN_BEFORE_CONFIG: bool[src]
fn create(
&self,
name: &'static str
) -> Result<Self::Resource, Box<dyn Error + 'static + Sync + Send>>[src]
&self,
name: &'static str
) -> Result<Self::Resource, Box<dyn Error + 'static + Sync + Send>>
fn init<B>(
builder: B,
&'static str
) -> Result<B, Box<dyn Error + 'static + Sync + Send>> 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]
builder: B,
&'static str
) -> Result<B, Box<dyn Error + 'static + Sync + Send>> 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,
impl<ExtraCfg: Hash, TcpStreamConfigure: Hash> Hash for TcpListen<ExtraCfg, TcpStreamConfigure>[src]
fn hash<__H: Hasher>(&self, state: &mut __H)[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<ExtraCfg: Ord, TcpStreamConfigure: Ord> Ord for TcpListen<ExtraCfg, TcpStreamConfigure>[src]
fn cmp(&self, other: &TcpListen<ExtraCfg, TcpStreamConfigure>) -> Ordering[src]
#[must_use]fn max(self, other: Self) -> Self1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self[src]
impl<ExtraCfg: PartialEq, TcpStreamConfigure: PartialEq> PartialEq<TcpListen<ExtraCfg, TcpStreamConfigure>> for TcpListen<ExtraCfg, TcpStreamConfigure>[src]
fn eq(&self, other: &TcpListen<ExtraCfg, TcpStreamConfigure>) -> bool[src]
fn ne(&self, other: &TcpListen<ExtraCfg, TcpStreamConfigure>) -> bool[src]
impl<ExtraCfg: PartialOrd, TcpStreamConfigure: PartialOrd> PartialOrd<TcpListen<ExtraCfg, TcpStreamConfigure>> for TcpListen<ExtraCfg, TcpStreamConfigure>[src]
fn partial_cmp(
&self,
other: &TcpListen<ExtraCfg, TcpStreamConfigure>
) -> Option<Ordering>[src]
&self,
other: &TcpListen<ExtraCfg, TcpStreamConfigure>
) -> Option<Ordering>
fn lt(&self, other: &TcpListen<ExtraCfg, TcpStreamConfigure>) -> bool[src]
fn le(&self, other: &TcpListen<ExtraCfg, TcpStreamConfigure>) -> bool[src]
fn gt(&self, other: &TcpListen<ExtraCfg, TcpStreamConfigure>) -> bool[src]
fn ge(&self, other: &TcpListen<ExtraCfg, TcpStreamConfigure>) -> bool[src]
impl<ExtraCfg, TcpStreamConfigure> Serialize for TcpListen<ExtraCfg, TcpStreamConfigure> where
ExtraCfg: Serialize,
TcpStreamConfigure: Serialize, [src]
ExtraCfg: Serialize,
TcpStreamConfigure: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer, [src]
__S: Serializer,
impl<ExtraCfg, TcpConfig> Stackable for TcpListen<ExtraCfg, TcpConfig>[src]
impl<ExtraCfg, TcpStreamConfigure> StructDoc for TcpListen<ExtraCfg, TcpStreamConfigure> where
ExtraCfg: StructDoc,
TcpStreamConfigure: StructDoc, [src]
ExtraCfg: StructDoc,
TcpStreamConfigure: StructDoc,
fn document() -> Documentation[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,
ExtraCfg: RefUnwindSafe,
TcpStreamConfigure: RefUnwindSafe,
impl<ExtraCfg, TcpStreamConfigure> Send for TcpListen<ExtraCfg, TcpStreamConfigure> where
ExtraCfg: Send,
TcpStreamConfigure: Send,
ExtraCfg: Send,
TcpStreamConfigure: Send,
impl<ExtraCfg, TcpStreamConfigure> Sync for TcpListen<ExtraCfg, TcpStreamConfigure> where
ExtraCfg: Sync,
TcpStreamConfigure: Sync,
ExtraCfg: Sync,
TcpStreamConfigure: Sync,
impl<ExtraCfg, TcpStreamConfigure> Unpin for TcpListen<ExtraCfg, TcpStreamConfigure> where
ExtraCfg: Unpin,
TcpStreamConfigure: Unpin,
ExtraCfg: Unpin,
TcpStreamConfigure: Unpin,
impl<ExtraCfg, TcpStreamConfigure> UnwindSafe for TcpListen<ExtraCfg, TcpStreamConfigure> where
ExtraCfg: UnwindSafe,
TcpStreamConfigure: UnwindSafe,
ExtraCfg: UnwindSafe,
TcpStreamConfigure: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>, [src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> IntoResult<T> for T[src]
impl<F> Optional for F where
F: Stackable, [src]
F: Stackable,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,