[−][src]Struct spirit_tokio::net::limits::WithListenLimits
A wrapper around a listening socket Fragment
that adds limits and error handling to it.
There's also the convenience type alias WithLimits
.
Note that the applied limits are per-instance. If there are two sockets in eg
Vec<TcpListenWithLimits>
, their limits are independent. In addition, if a configuration of a
socket changes, the old listening socket is destroyed but the old connections are kept around
until they terminate. The new listening socket starts with fresh limits, not counting the old
connections.
Fields
listener: Listener
The inner listener socket.
This is available publicly to allow reading the extra configuration out of it.
Trait Implementations
impl<Listener: Clone, Limits: Clone> Clone for WithListenLimits<Listener, Limits>
[src]
fn clone(&self) -> WithListenLimits<Listener, Limits>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<Listener: PartialEq, Limits: PartialEq> PartialEq<WithListenLimits<Listener, Limits>> for WithListenLimits<Listener, Limits>
[src]
fn eq(&self, other: &WithListenLimits<Listener, Limits>) -> bool
[src]
fn ne(&self, other: &WithListenLimits<Listener, Limits>) -> bool
[src]
impl<Listener: PartialOrd, Limits: PartialOrd> PartialOrd<WithListenLimits<Listener, Limits>> for WithListenLimits<Listener, Limits>
[src]
fn partial_cmp(
&self,
other: &WithListenLimits<Listener, Limits>
) -> Option<Ordering>
[src]
&self,
other: &WithListenLimits<Listener, Limits>
) -> Option<Ordering>
fn lt(&self, other: &WithListenLimits<Listener, Limits>) -> bool
[src]
fn le(&self, other: &WithListenLimits<Listener, Limits>) -> bool
[src]
fn gt(&self, other: &WithListenLimits<Listener, Limits>) -> bool
[src]
fn ge(&self, other: &WithListenLimits<Listener, Limits>) -> bool
[src]
impl<Listener: Ord, Limits: Ord> Ord for WithListenLimits<Listener, Limits>
[src]
fn cmp(&self, other: &WithListenLimits<Listener, Limits>) -> Ordering
[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]
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<Listener: Eq, Limits: Eq> Eq for WithListenLimits<Listener, Limits>
[src]
impl<Listener: Default, Limits: Default> Default for WithListenLimits<Listener, Limits>
[src]
fn default() -> WithListenLimits<Listener, Limits>
[src]
impl<Listener: Hash, Limits: Hash> Hash for WithListenLimits<Listener, Limits>
[src]
fn hash<__HListenerLimits: Hasher>(&self, state: &mut __HListenerLimits)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<Listener: Debug, Limits: Debug> Debug for WithListenLimits<Listener, Limits>
[src]
impl<Listener, Limits> Serialize for WithListenLimits<Listener, Limits> where
Listener: Serialize,
Limits: Serialize,
[src]
Listener: Serialize,
Limits: Serialize,
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de, Listener, Limits> Deserialize<'de> for WithListenLimits<Listener, Limits> where
Listener: Deserialize<'de>,
Limits: Deserialize<'de>,
[src]
Listener: Deserialize<'de>,
Limits: Deserialize<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<Listener, Limits> Comparable<WithListenLimits<Listener, Limits>> for WithListenLimits<Listener, Limits> where
Listener: Comparable,
Limits: PartialEq,
[src]
Listener: Comparable,
Limits: PartialEq,
fn compare(&self, other: &Self) -> Comparison
[src]
impl<Listener, Limits> Fragment for WithListenLimits<Listener, Limits> where
Listener: Clone + Debug + Fragment + Comparable,
Limits: Clone + Debug + ListenLimits + PartialEq,
[src]
Listener: Clone + Debug + Fragment + Comparable,
Limits: Clone + Debug + ListenLimits + 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 = Listener::Seed
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 = LimitedListener<Listener::Resource>
The actual product this [Fragment
] creates.
const RUN_BEFORE_CONFIG: bool
[src]
fn make_seed(&self, name: &'static str) -> Result<Self::Seed, Error>
[src]
fn make_resource(
&self,
seed: &mut Self::Seed,
name: &'static str
) -> Result<Self::Resource, Error>
[src]
&self,
seed: &mut Self::Seed,
name: &'static str
) -> Result<Self::Resource, Error>
fn init<B: Extensible<Ok = B>>(
builder: B,
name: &'static str
) -> Result<B, Error> where
B::Config: DeserializeOwned + Send + Sync + 'static,
B::Opts: StructOpt + Send + Sync + 'static,
[src]
builder: B,
name: &'static str
) -> Result<B, Error> where
B::Config: DeserializeOwned + Send + Sync + 'static,
B::Opts: StructOpt + Send + Sync + 'static,
fn create(&self, name: &'static str) -> Result<Self::Resource, Error>
[src]
Runs both stages of creation at once. Read more
impl<Listener, Limits> Stackable for WithListenLimits<Listener, Limits> where
Listener: Stackable,
[src]
Listener: Stackable,
impl<Listener, Limits> StructDoc for WithListenLimits<Listener, Limits> where
Listener: StructDoc,
Limits: StructDoc,
[src]
Listener: StructDoc,
Limits: StructDoc,
fn document() -> Documentation
[src]
Auto Trait Implementations
impl<Listener, Limits> Send for WithListenLimits<Listener, Limits> where
Limits: Send,
Listener: Send,
Limits: Send,
Listener: Send,
impl<Listener, Limits> Sync for WithListenLimits<Listener, Limits> where
Limits: Sync,
Listener: Sync,
Limits: Sync,
Listener: Sync,
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> IntoResult for T
[src]
fn into_result(self) -> Result<T, Error>
[src]
impl<F> Optional for F where
F: Stackable,
[src]
F: Stackable,