pub struct AssertUnwindSafe<T>(pub T);
Expand description
A simple wrapper around a type to assert that it is unwind safe.
When using catch_unwind
it may be the case that some of the closed over
variables are not unwind safe. For example if &mut T
is captured the
compiler will generate a warning indicating that it is not unwind safe. It
might not be the case, however, that this is actually a problem due to the
specific usage of catch_unwind
if unwind safety is specifically taken into
account. This wrapper struct is useful for a quick and lightweight
annotation that a variable is indeed unwind safe.
ยงExamples
One way to use AssertUnwindSafe
is to assert that the entire closure
itself is unwind safe, bypassing all checks for all variables:
use std::panic::{self, AssertUnwindSafe};
let mut variable = 4;
// This code will not compile because the closure captures `&mut variable`
// which is not considered unwind safe by default.
// panic::catch_unwind(|| {
// variable += 3;
// });
// This, however, will compile due to the `AssertUnwindSafe` wrapper
let result = panic::catch_unwind(AssertUnwindSafe(|| {
variable += 3;
}));
// ...
Wrapping the entire closure amounts to a blanket assertion that all captured variables are unwind safe. This has the downside that if new captures are added in the future, they will also be considered unwind safe. Therefore, you may prefer to just wrap individual captures, as shown below. This is more annotation, but it ensures that if a new capture is added which is not unwind safe, you will get a compilation error at that time, which will allow you to consider whether that new capture in fact represent a bug or not.
use std::panic::{self, AssertUnwindSafe};
let mut variable = 4;
let other_capture = 3;
let result = {
let mut wrapper = AssertUnwindSafe(&mut variable);
panic::catch_unwind(move || {
**wrapper += other_capture;
})
};
// ...
Tuple Fieldsยง
ยง0: T
Trait Implementationsยง
Sourceยงimpl<S> AsyncIterator for AssertUnwindSafe<S>where
S: AsyncIterator,
impl<S> AsyncIterator for AssertUnwindSafe<S>where
S: AsyncIterator,
Sourceยงtype Item = <S as AsyncIterator>::Item
type Item = <S as AsyncIterator>::Item
async_iterator
)Sourceยงfn poll_next(
self: Pin<&mut AssertUnwindSafe<S>>,
cx: &mut Context<'_>,
) -> Poll<Option<<S as AsyncIterator>::Item>>
fn poll_next( self: Pin<&mut AssertUnwindSafe<S>>, cx: &mut Context<'_>, ) -> Poll<Option<<S as AsyncIterator>::Item>>
async_iterator
)None
if the async iterator is exhausted. Read moreSourceยงimpl<C> ClockSequence for AssertUnwindSafe<C>where
C: ClockSequence,
impl<C> ClockSequence for AssertUnwindSafe<C>where
C: ClockSequence,
Sourceยงtype Output = <C as ClockSequence>::Output
type Output = <C as ClockSequence>::Output
Sourceยงfn generate_sequence(
&self,
seconds: u64,
subsec_nanos: u32,
) -> <AssertUnwindSafe<C> as ClockSequence>::Output โ
fn generate_sequence( &self, seconds: u64, subsec_nanos: u32, ) -> <AssertUnwindSafe<C> as ClockSequence>::Output โ
Sourceยงfn generate_timestamp_sequence(
&self,
seconds: u64,
subsec_nanos: u32,
) -> (<AssertUnwindSafe<C> as ClockSequence>::Output, u64, u32)
fn generate_timestamp_sequence( &self, seconds: u64, subsec_nanos: u32, ) -> (<AssertUnwindSafe<C> as ClockSequence>::Output, u64, u32)
Sourceยงfn usable_bits(&self) -> usize
fn usable_bits(&self) -> usize
ClockSequence::generate_sequence
or ClockSequence::generate_timestamp_sequence
. Read more1.16.0 ยท Sourceยงimpl<T> Debug for AssertUnwindSafe<T>where
T: Debug,
impl<T> Debug for AssertUnwindSafe<T>where
T: Debug,
1.62.0 ยท Sourceยงimpl<T> Default for AssertUnwindSafe<T>where
T: Default,
impl<T> Default for AssertUnwindSafe<T>where
T: Default,
1.9.0 ยท Sourceยงimpl<T> Deref for AssertUnwindSafe<T>
impl<T> Deref for AssertUnwindSafe<T>
1.9.0 ยท Sourceยงimpl<T> DerefMut for AssertUnwindSafe<T>
impl<T> DerefMut for AssertUnwindSafe<T>
1.9.0 ยท Sourceยงimpl<R, F> FnOnce() for AssertUnwindSafe<F>where
F: FnOnce() -> R,
impl<R, F> FnOnce() for AssertUnwindSafe<F>where
F: FnOnce() -> R,
ยงimpl<F> FusedFuture for AssertUnwindSafe<F>where
F: FusedFuture,
impl<F> FusedFuture for AssertUnwindSafe<F>where
F: FusedFuture,
ยงfn is_terminated(&self) -> bool
fn is_terminated(&self) -> bool
true
if the underlying future should no longer be polled.1.36.0 ยท Sourceยงimpl<F> Future for AssertUnwindSafe<F>where
F: Future,
impl<F> Future for AssertUnwindSafe<F>where
F: Future,
ยงimpl<S> Stream for AssertUnwindSafe<S>where
S: Stream,
impl<S> Stream for AssertUnwindSafe<S>where
S: Stream,
impl<T> RefUnwindSafe for AssertUnwindSafe<T>
impl<T> UnwindSafe for AssertUnwindSafe<T>
Auto Trait Implementationsยง
impl<T> Freeze for AssertUnwindSafe<T>where
T: Freeze,
impl<T> Send for AssertUnwindSafe<T>where
T: Send,
impl<T> Sync for AssertUnwindSafe<T>where
T: Sync,
impl<T> Unpin for AssertUnwindSafe<T>where
T: Unpin,
Blanket Implementationsยง
ยงimpl<T, A, P> Access<T> for P
impl<T, A, P> Access<T> for P
Sourceยงimpl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for Swhere
T: Real + Zero + Arithmetics + Clone,
Swp: WhitePoint<T>,
Dwp: WhitePoint<T>,
D: AdaptFrom<S, Swp, Dwp, T>,
Sourceยงfn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
fn adapt_into_using<M>(self, method: M) -> Dwhere
M: TransformMatrix<T>,
Sourceยงfn adapt_into(self) -> D
fn adapt_into(self) -> D
ยงimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
ยงtype ArchivedMetadata = ()
type ArchivedMetadata = ()
ยงfn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Sourceยงimpl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
impl<T, C> ArraysFrom<C> for Twhere
C: IntoArrays<T>,
Sourceยงfn arrays_from(colors: C) -> T
fn arrays_from(colors: C) -> T
Sourceยงimpl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
impl<T, C> ArraysInto<C> for Twhere
C: FromArrays<T>,
Sourceยงfn arrays_into(self) -> C
fn arrays_into(self) -> C
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Sourceยงimpl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for Uwhere
T: FromCam16Unclamped<WpParam, U>,
Sourceยงtype Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar
parameters
when converting.Sourceยงfn cam16_into_unclamped(
self,
parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>,
) -> T
fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.ยงimpl<Func, T> ComponentConstructor<(), T> for Funcwhere
Func: FnOnce() -> T,
impl<Func, T> ComponentConstructor<(), T> for Funcwhere
Func: FnOnce() -> T,
Sourceยงimpl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
impl<T, C> ComponentsFrom<C> for Twhere
C: IntoComponents<T>,
Sourceยงfn components_from(colors: C) -> T
fn components_from(colors: C) -> T
ยงimpl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
ยงfn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
ยงimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
ยงfn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.ยงfn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.ยงfn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
โs vtable from &Trait
โs.ยงfn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
โs vtable from &mut Trait
โs.ยงimpl<T> DowncastSend for T
impl<T> DowncastSend for T
ยงimpl<T> DowncastSync for T
impl<T> DowncastSync for T
ยงimpl<T, A> DynAccess<T> for Awhere
A: Access<T>,
<A as Access<T>>::Guard: 'static,
impl<T, A> DynAccess<T> for Awhere
A: Access<T>,
<A as Access<T>>::Guard: 'static,
Sourceยงimpl<T> FromAngle<T> for T
impl<T> FromAngle<T> for T
Sourceยงfn from_angle(angle: T) -> T
fn from_angle(angle: T) -> T
angle
.Sourceยงimpl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
impl<T, U> FromStimulus<U> for Twhere
U: IntoStimulus<T>,
Sourceยงfn from_stimulus(other: U) -> T
fn from_stimulus(other: U) -> T
other
into Self
, while performing the appropriate scaling,
rounding and clamping.ยงimpl<T> FutureExt for T
impl<T> FutureExt for T
ยงfn map<U, F>(self, f: F) -> Map<Self, F> โ
fn map<U, F>(self, f: F) -> Map<Self, F> โ
ยงfn map_into<U>(self) -> MapInto<Self, U> โ
fn map_into<U>(self) -> MapInto<Self, U> โ
ยงfn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> โ
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> โ
f
. Read moreยงfn left_future<B>(self) -> Either<Self, B> โ
fn left_future<B>(self) -> Either<Self, B> โ
ยงfn right_future<A>(self) -> Either<A, Self> โ
fn right_future<A>(self) -> Either<A, Self> โ
ยงfn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
ยงfn flatten(self) -> Flatten<Self> โ
fn flatten(self) -> Flatten<Self> โ
ยงfn flatten_stream(self) -> FlattenStream<Self>
fn flatten_stream(self) -> FlattenStream<Self>
ยงfn fuse(self) -> Fuse<Self> โwhere
Self: Sized,
fn fuse(self) -> Fuse<Self> โwhere
Self: Sized,
poll
will never again be called once it has
completed. This method can be used to turn any Future
into a
FusedFuture
. Read moreยงfn inspect<F>(self, f: F) -> Inspect<Self, F> โ
fn inspect<F>(self, f: F) -> Inspect<Self, F> โ
ยงfn catch_unwind(self) -> CatchUnwind<Self> โwhere
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self> โwhere
Self: Sized + UnwindSafe,
ยงfn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)where
Self: Sized,
()
on completion and sends
its output to another future on a separate task. Read moreยงfn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + Send + 'a>>
ยงfn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>where
Self: Sized + 'a,
ยงfn unit_error(self) -> UnitError<Self> โwhere
Self: Sized,
fn unit_error(self) -> UnitError<Self> โwhere
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = ()
>.ยงfn never_error(self) -> NeverError<Self> โwhere
Self: Sized,
fn never_error(self) -> NeverError<Self> โwhere
Self: Sized,
Future<Output = T>
into a
TryFuture<Ok = T, Error = Never
>.ยงimpl<T> FutureExt for T
impl<T> FutureExt for T
ยงfn with_cancellation_token(
self,
cancellation_token: &CancellationToken,
) -> WithCancellationTokenFuture<'_, Self>where
Self: Sized,
fn with_cancellation_token(
self,
cancellation_token: &CancellationToken,
) -> WithCancellationTokenFuture<'_, Self>where
Self: Sized,
CancellationToken::run_until_cancelled
],
but with the advantage that it is easier to write fluent call chains,
and biased towards waiting for [CancellationToken
] to complete. Read moreยงfn with_cancellation_token_owned(
self,
cancellation_token: CancellationToken,
) -> WithCancellationTokenFutureOwned<Self>where
Self: Sized,
fn with_cancellation_token_owned(
self,
cancellation_token: CancellationToken,
) -> WithCancellationTokenFutureOwned<Self>where
Self: Sized,
CancellationToken::run_until_cancelled_owned
],
but with the advantage that it is easier to write fluent call chains,
and biased towards waiting for [CancellationToken
] to complete. Read moreยงimpl<T> Instrument for T
impl<T> Instrument for T
ยงfn instrument(self, span: Span) -> Instrumented<Self> โ
fn instrument(self, span: Span) -> Instrumented<Self> โ
Sourceยงimpl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
impl<T, U> IntoAngle<U> for Twhere
U: FromAngle<T>,
Sourceยงfn into_angle(self) -> U
fn into_angle(self) -> U
T
.Sourceยงimpl<I> IntoAsyncIterator for Iwhere
I: AsyncIterator,
impl<I> IntoAsyncIterator for Iwhere
I: AsyncIterator,
Sourceยงtype Item = <I as AsyncIterator>::Item
type Item = <I as AsyncIterator>::Item
async_iterator
)Sourceยงtype IntoAsyncIter = I
type IntoAsyncIter = I
async_iterator
)Sourceยงfn into_async_iter(self) -> <I as IntoAsyncIterator>::IntoAsyncIter
fn into_async_iter(self) -> <I as IntoAsyncIterator>::IntoAsyncIter
async_iterator
)self
into an async iteratorSourceยงimpl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for Uwhere
T: Cam16FromUnclamped<WpParam, U>,
Sourceยงtype Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar
parameters
when converting.Sourceยงfn into_cam16_unclamped(
self,
parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>,
) -> T
fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T
self
into C
, using the provided parameters.Sourceยงimpl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
impl<T, U> IntoColor<U> for Twhere
U: FromColor<T>,
Sourceยงfn into_color(self) -> U
fn into_color(self) -> U
Sourceยงimpl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
impl<T, U> IntoColorUnclamped<U> for Twhere
U: FromColorUnclamped<T>,
Sourceยงfn into_color_unclamped(self) -> U
fn into_color_unclamped(self) -> U
Sourceยงimpl<T> IntoEither for T
impl<T> IntoEither for T
Sourceยงfn into_either(self, into_left: bool) -> Either<Self, Self> โ
fn into_either(self, into_left: bool) -> Either<Self, Self> โ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงfn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSourceยงimpl<F> IntoFuture for Fwhere
F: Future,
impl<F> IntoFuture for Fwhere
F: Future,
Sourceยงtype IntoFuture = F
type IntoFuture = F
Sourceยงfn into_future(self) -> <F as IntoFuture>::IntoFuture
fn into_future(self) -> <F as IntoFuture>::IntoFuture
ยงimpl<E, T, Request> IntoReq<StreamingText, Request, E> for T
impl<E, T, Request> IntoReq<StreamingText, Request, E> for T
Sourceยงimpl<T> IntoStimulus<T> for T
impl<T> IntoStimulus<T> for T
Sourceยงfn into_stimulus(self) -> T
fn into_stimulus(self) -> T
self
into T
, while performing the appropriate scaling,
rounding and clamping.ยงimpl<T> Pointable for T
impl<T> Pointable for T
ยงimpl<T> Pointee for T
impl<T> Pointee for T
ยงimpl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Sourceยงimpl<R> Rng for R
impl<R> Rng for R
Sourceยงfn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn random<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
StandardUniform
distribution. Read moreSourceยงfn random_iter<T>(self) -> Iter<StandardUniform, Self, T> โ
fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> โ
Sourceยงfn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn random_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
Sourceยงfn random_bool(&mut self, p: f64) -> bool
fn random_bool(&mut self, p: f64) -> bool
p
of being true. Read moreSourceยงfn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool
numerator/denominator
of being
true. Read moreSourceยงfn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
fn sample<T, D>(&mut self, distr: D) -> Twhere
D: Distribution<T>,
Sourceยงfn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> โwhere
D: Distribution<T>,
Self: Sized,
fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> โwhere
D: Distribution<T>,
Self: Sized,
Sourceยงfn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
fn gen<T>(&mut self) -> Twhere
StandardUniform: Distribution<T>,
random
to avoid conflict with the new gen
keyword in Rust 2024.Rng::random
.Sourceยงfn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
fn gen_range<T, R>(&mut self, range: R) -> Twhere
T: SampleUniform,
R: SampleRange<T>,
random_range
Rng::random_range
.ยงimpl<T> SerializableKey for T
impl<T> SerializableKey for T
ยงimpl<T> StorageAccess<T> for T
impl<T> StorageAccess<T> for T
ยงfn as_borrowed(&self) -> &T
fn as_borrowed(&self) -> &T
ยงfn into_taken(self) -> T
fn into_taken(self) -> T
ยงimpl<St> StreamExt for Stwhere
St: Stream + ?Sized,
impl<St> StreamExt for Stwhere
St: Stream + ?Sized,
ยงfn next(&mut self) -> Next<'_, Self>where
Self: Unpin,
fn next(&mut self) -> Next<'_, Self>where
Self: Unpin,
None
if the
stream is finished. Read moreยงfn try_next<T, E>(&mut self) -> TryNext<'_, Self>
fn try_next<T, E>(&mut self) -> TryNext<'_, Self>
ยงfn map<T, F>(self, f: F) -> Map<Self, F>
fn map<T, F>(self, f: F) -> Map<Self, F>
ยงfn map_while<T, F>(self, f: F) -> MapWhile<Self, F>
fn map_while<T, F>(self, f: F) -> MapWhile<Self, F>
None
. Read moreยงfn then<F, Fut>(self, f: F) -> Then<Self, Fut, F>
fn then<F, Fut>(self, f: F) -> Then<Self, Fut, F>
ยงfn merge<U>(self, other: U) -> Merge<Self, U>where
U: Stream<Item = Self::Item>,
Self: Sized,
fn merge<U>(self, other: U) -> Merge<Self, U>where
U: Stream<Item = Self::Item>,
Self: Sized,
ยงfn filter<F>(self, f: F) -> Filter<Self, F>
fn filter<F>(self, f: F) -> Filter<Self, F>
ยงfn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
ยงfn fuse(self) -> Fuse<Self>where
Self: Sized,
fn fuse(self) -> Fuse<Self>where
Self: Sized,
None
. Read moreยงfn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
n
items of the underlying stream. Read moreยงfn take_while<F>(self, f: F) -> TakeWhile<Self, F>
fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
true
. Read moreยงfn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n
first items of the
underlying stream. Read moreยงfn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
fn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
true
. Read moreยงfn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F>
fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F>
ยงfn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F>
fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F>
ยงfn chain<U>(self, other: U) -> Chain<Self, U>where
U: Stream<Item = Self::Item>,
Self: Sized,
fn chain<U>(self, other: U) -> Chain<Self, U>where
U: Stream<Item = Self::Item>,
Self: Sized,
ยงfn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, B, F>
fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, B, F>
ยงfn collect<T>(self) -> Collect<Self, T>where
T: FromStream<Self::Item>,
Self: Sized,
fn collect<T>(self) -> Collect<Self, T>where
T: FromStream<Self::Item>,
Self: Sized,
ยงfn timeout(self, duration: Duration) -> Timeout<Self>where
Self: Sized,
fn timeout(self, duration: Duration) -> Timeout<Self>where
Self: Sized,
ยงfn timeout_repeating(self, interval: Interval) -> TimeoutRepeating<Self>where
Self: Sized,
fn timeout_repeating(self, interval: Interval) -> TimeoutRepeating<Self>where
Self: Sized,
ยงfn throttle(self, duration: Duration) -> Throttle<Self>where
Self: Sized,
fn throttle(self, duration: Duration) -> Throttle<Self>where
Self: Sized,
ยงimpl<T> StreamExt for Twhere
T: Stream + ?Sized,
impl<T> StreamExt for Twhere
T: Stream + ?Sized,
ยงfn next(&mut self) -> Next<'_, Self> โwhere
Self: Unpin,
fn next(&mut self) -> Next<'_, Self> โwhere
Self: Unpin,
ยงfn into_future(self) -> StreamFuture<Self> โ
fn into_future(self) -> StreamFuture<Self> โ
ยงfn map<T, F>(self, f: F) -> Map<Self, F>
fn map<T, F>(self, f: F) -> Map<Self, F>
ยงfn enumerate(self) -> Enumerate<Self>where
Self: Sized,
fn enumerate(self) -> Enumerate<Self>where
Self: Sized,
ยงfn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
ยงfn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
ยงfn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
ยงfn collect<C>(self) -> Collect<Self, C> โ
fn collect<C>(self) -> Collect<Self, C> โ
ยงfn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> โ
fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> โ
ยงfn concat(self) -> Concat<Self> โ
fn concat(self) -> Concat<Self> โ
ยงfn count(self) -> Count<Self> โwhere
Self: Sized,
fn count(self) -> Count<Self> โwhere
Self: Sized,
ยงfn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F> โ
fn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F> โ
ยงfn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> โ
fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> โ
true
if any element in stream satisfied a predicate. Read moreยงfn all<Fut, F>(self, f: F) -> All<Self, Fut, F> โ
fn all<Fut, F>(self, f: F) -> All<Self, Fut, F> โ
true
if all element in stream satisfied a predicate. Read moreยงfn flatten(self) -> Flatten<Self>where
Self::Item: Stream,
Self: Sized,
fn flatten(self) -> Flatten<Self>where
Self::Item: Stream,
Self: Sized,
ยงfn flatten_unordered(
self,
limit: impl Into<Option<usize>>,
) -> FlattenUnorderedWithFlowController<Self, ()>
fn flatten_unordered( self, limit: impl Into<Option<usize>>, ) -> FlattenUnorderedWithFlowController<Self, ()>
ยงfn flat_map_unordered<U, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> FlatMapUnordered<Self, U, F>
fn flat_map_unordered<U, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> FlatMapUnordered<Self, U, F>
StreamExt::map
] but flattens nested Stream
s
and polls them concurrently, yielding items in any order, as they made
available. Read moreยงfn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F>
fn scan<S, B, Fut, F>(self, initial_state: S, f: F) -> Scan<Self, S, Fut, F>
StreamExt::fold
] that holds internal state
and produces a new stream. Read moreยงfn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>
fn skip_while<Fut, F>(self, f: F) -> SkipWhile<Self, Fut, F>
true
. Read moreยงfn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
true
. Read moreยงfn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
ยงfn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> โ
fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> โ
ยงfn for_each_concurrent<Fut, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> ForEachConcurrent<Self, Fut, F> โ
fn for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> ForEachConcurrent<Self, Fut, F> โ
ยงfn take(self, n: usize) -> Take<Self>where
Self: Sized,
fn take(self, n: usize) -> Take<Self>where
Self: Sized,
n
items of the underlying stream. Read moreยงfn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
fn skip(self, n: usize) -> Skip<Self>where
Self: Sized,
n
items of the underlying stream. Read moreยงfn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
fn catch_unwind(self) -> CatchUnwind<Self>where
Self: Sized + UnwindSafe,
ยงfn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
ยงfn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>where
Self: Sized + 'a,
fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>where
Self: Sized + 'a,
ยงfn buffered(self, n: usize) -> Buffered<Self>
fn buffered(self, n: usize) -> Buffered<Self>
ยงfn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
ยงfn zip<St>(self, other: St) -> Zip<Self, St>where
St: Stream,
Self: Sized,
fn zip<St>(self, other: St) -> Zip<Self, St>where
St: Stream,
Self: Sized,
ยงfn chain<St>(self, other: St) -> Chain<Self, St>where
St: Stream<Item = Self::Item>,
Self: Sized,
fn chain<St>(self, other: St) -> Chain<Self, St>where
St: Stream<Item = Self::Item>,
Self: Sized,
ยงfn peekable(self) -> Peekable<Self>where
Self: Sized,
fn peekable(self) -> Peekable<Self>where
Self: Sized,
peek
method. Read moreยงfn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
fn chunks(self, capacity: usize) -> Chunks<Self>where
Self: Sized,
ยงfn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>where
Self: Sized,
ยงfn forward<S>(self, sink: S) -> Forward<Self, S> โwhere
S: Sink<Self::Ok, Error = Self::Error>,
Self: Sized + TryStream,
fn forward<S>(self, sink: S) -> Forward<Self, S> โwhere
S: Sink<Self::Ok, Error = Self::Error>,
Self: Sized + TryStream,
ยงfn inspect<F>(self, f: F) -> Inspect<Self, F>
fn inspect<F>(self, f: F) -> Inspect<Self, F>
ยงfn left_stream<B>(self) -> Either<Self, B> โwhere
B: Stream<Item = Self::Item>,
Self: Sized,
fn left_stream<B>(self) -> Either<Self, B> โwhere
B: Stream<Item = Self::Item>,
Self: Sized,
ยงfn right_stream<B>(self) -> Either<B, Self> โwhere
B: Stream<Item = Self::Item>,
Self: Sized,
fn right_stream<B>(self) -> Either<B, Self> โwhere
B: Stream<Item = Self::Item>,
Self: Sized,
Sourceยงimpl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
impl<T, C> TryComponentsInto<C> for Twhere
C: TryFromComponents<T>,
Sourceยงtype Error = <C as TryFromComponents<T>>::Error
type Error = <C as TryFromComponents<T>>::Error
try_into_colors
fails to cast.Sourceยงfn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>
ยงimpl<F, T, E> TryFuture for F
impl<F, T, E> TryFuture for F
ยงimpl<Fut> TryFutureExt for Futwhere
Fut: TryFuture + ?Sized,
impl<Fut> TryFutureExt for Futwhere
Fut: TryFuture + ?Sized,
ยงfn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>where
Self::Ok: Sink<Item, Error = Self::Error>,
Self: Sized,
fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>where
Self::Ok: Sink<Item, Error = Self::Error>,
Self: Sized,
Sink
]. Read moreยงfn map_ok<T, F>(self, f: F) -> MapOk<Self, F> โ
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F> โ
ยงfn map_ok_or_else<T, E, F>(self, e: E, f: F) -> MapOkOrElse<Self, F, E> โ
fn map_ok_or_else<T, E, F>(self, e: E, f: F) -> MapOkOrElse<Self, F, E> โ
ยงfn map_err<E, F>(self, f: F) -> MapErr<Self, F> โ
fn map_err<E, F>(self, f: F) -> MapErr<Self, F> โ
ยงfn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> โ
fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> โ
ยงfn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> โ
fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> โ
ยงfn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> โ
fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> โ
ยงfn inspect_err<F>(self, f: F) -> InspectErr<Self, F> โ
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> โ
ยงfn try_flatten(self) -> TryFlatten<Self, Self::Ok> โwhere
Self::Ok: TryFuture<Error = Self::Error>,
Self: Sized,
fn try_flatten(self) -> TryFlatten<Self, Self::Ok> โwhere
Self::Ok: TryFuture<Error = Self::Error>,
Self: Sized,
ยงfn try_flatten_stream(self) -> TryFlattenStream<Self>where
Self::Ok: TryStream<Error = Self::Error>,
Self: Sized,
fn try_flatten_stream(self) -> TryFlattenStream<Self>where
Self::Ok: TryStream<Error = Self::Error>,
Self: Sized,
ยงfn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> โ
fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> โ
ยงfn into_future(self) -> IntoFuture<Self> โwhere
Self: Sized,
fn into_future(self) -> IntoFuture<Self> โwhere
Self: Sized,
Sourceยงimpl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
impl<T, U> TryIntoColor<U> for Twhere
U: TryFromColor<T>,
Sourceยงfn try_into_color(self) -> Result<U, OutOfBounds<U>>
fn try_into_color(self) -> Result<U, OutOfBounds<U>>
OutOfBounds
error is returned which contains
the unclamped color. Read moreSourceยงimpl<R> TryRngCore for R
impl<R> TryRngCore for R
Sourceยงtype Error = Infallible
type Error = Infallible
Sourceยงfn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>
u32
.Sourceยงfn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>
u64
.Sourceยงfn try_fill_bytes(
&mut self,
dst: &mut [u8],
) -> Result<(), <R as TryRngCore>::Error>
fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>
dest
entirely with random data.Sourceยงfn unwrap_err(self) -> UnwrapErr<Self>where
Self: Sized,
fn unwrap_err(self) -> UnwrapErr<Self>where
Self: Sized,
UnwrapErr
wrapper.Sourceยงfn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>
UnwrapMut
wrapper.Sourceยงfn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>where
Self: Sized,
RngCore
to a RngReadAdapter
.ยงimpl<S, T, E> TryStream for S
impl<S, T, E> TryStream for S
ยงimpl<S> TryStreamExt for Swhere
S: TryStream + ?Sized,
impl<S> TryStreamExt for Swhere
S: TryStream + ?Sized,
ยงfn err_into<E>(self) -> ErrInto<Self, E>
fn err_into<E>(self) -> ErrInto<Self, E>
ยงfn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
ยงfn map_err<E, F>(self, f: F) -> MapErr<Self, F>
fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
ยงfn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
f
. Read moreยงfn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F>
fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F>
f
. Read moreยงfn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
ยงfn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
ยงfn into_stream(self) -> IntoStream<Self>where
Self: Sized,
fn into_stream(self) -> IntoStream<Self>where
Self: Sized,
ยงfn try_next(&mut self) -> TryNext<'_, Self> โwhere
Self: Unpin,
fn try_next(&mut self) -> TryNext<'_, Self> โwhere
Self: Unpin,
ยงfn try_for_each<Fut, F>(self, f: F) -> TryForEach<Self, Fut, F> โ
fn try_for_each<Fut, F>(self, f: F) -> TryForEach<Self, Fut, F> โ
ยงfn try_skip_while<Fut, F>(self, f: F) -> TrySkipWhile<Self, Fut, F>
fn try_skip_while<Fut, F>(self, f: F) -> TrySkipWhile<Self, Fut, F>
true
. Read moreยงfn try_take_while<Fut, F>(self, f: F) -> TryTakeWhile<Self, Fut, F>
fn try_take_while<Fut, F>(self, f: F) -> TryTakeWhile<Self, Fut, F>
true
. Read moreยงfn try_for_each_concurrent<Fut, F>(
self,
limit: impl Into<Option<usize>>,
f: F,
) -> TryForEachConcurrent<Self, Fut, F> โ
fn try_for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> TryForEachConcurrent<Self, Fut, F> โ
ยงfn try_collect<C>(self) -> TryCollect<Self, C> โ
fn try_collect<C>(self) -> TryCollect<Self, C> โ
ยงfn try_chunks(self, capacity: usize) -> TryChunks<Self>where
Self: Sized,
fn try_chunks(self, capacity: usize) -> TryChunks<Self>where
Self: Sized,
ยงfn try_ready_chunks(self, capacity: usize) -> TryReadyChunks<Self>where
Self: Sized,
fn try_ready_chunks(self, capacity: usize) -> TryReadyChunks<Self>where
Self: Sized,
ยงfn try_filter<Fut, F>(self, f: F) -> TryFilter<Self, Fut, F>
fn try_filter<Fut, F>(self, f: F) -> TryFilter<Self, Fut, F>
ยงfn try_filter_map<Fut, F, T>(self, f: F) -> TryFilterMap<Self, Fut, F>
fn try_filter_map<Fut, F, T>(self, f: F) -> TryFilterMap<Self, Fut, F>
ยงfn try_flatten_unordered(
self,
limit: impl Into<Option<usize>>,
) -> TryFlattenUnordered<Self>
fn try_flatten_unordered( self, limit: impl Into<Option<usize>>, ) -> TryFlattenUnordered<Self>
ยงfn try_flatten(self) -> TryFlatten<Self>
fn try_flatten(self) -> TryFlatten<Self>
ยงfn try_fold<T, Fut, F>(self, init: T, f: F) -> TryFold<Self, Fut, T, F> โ
fn try_fold<T, Fut, F>(self, init: T, f: F) -> TryFold<Self, Fut, T, F> โ
ยงfn try_concat(self) -> TryConcat<Self> โ
fn try_concat(self) -> TryConcat<Self> โ
ยงfn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>where
Self::Ok: TryFuture<Error = Self::Error>,
Self: Sized,
fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>where
Self::Ok: TryFuture<Error = Self::Error>,
Self: Sized,
ยงfn try_buffered(self, n: usize) -> TryBuffered<Self>where
Self::Ok: TryFuture<Error = Self::Error>,
Self: Sized,
fn try_buffered(self, n: usize) -> TryBuffered<Self>where
Self::Ok: TryFuture<Error = Self::Error>,
Self: Sized,
ยงfn try_poll_next_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Self::Ok, Self::Error>>>where
Self: Unpin,
fn try_poll_next_unpin(
&mut self,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Self::Ok, Self::Error>>>where
Self: Unpin,
TryStream::try_poll_next
] on Unpin
stream types.ยงfn into_async_read(self) -> IntoAsyncRead<Self>
fn into_async_read(self) -> IntoAsyncRead<Self>
AsyncBufRead
. Read moreยงfn try_all<Fut, F>(self, f: F) -> TryAll<Self, Fut, F> โ
fn try_all<Fut, F>(self, f: F) -> TryAll<Self, Fut, F> โ
Err
is encountered or if an Ok
item is found
that does not satisfy the predicate. Read more