Struct AssertUnwindSafe

1.41.0 ยท Source
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,

Sourceยง

type Item = <S as AsyncIterator>::Item

๐Ÿ”ฌThis is a nightly-only experimental API. (async_iterator)
The type of items yielded by the async iterator.
Sourceยง

fn poll_next( self: Pin<&mut AssertUnwindSafe<S>>, cx: &mut Context<'_>, ) -> Poll<Option<<S as AsyncIterator>::Item>>

๐Ÿ”ฌThis is a nightly-only experimental API. (async_iterator)
Attempts to pull out the next value of this async iterator, registering the current task for wakeup if the value is not yet available, and returning None if the async iterator is exhausted. Read more
Sourceยง

fn size_hint(&self) -> (usize, Option<usize>)

๐Ÿ”ฌThis is a nightly-only experimental API. (async_iterator)
Returns the bounds on the remaining length of the async iterator. Read more
Sourceยง

impl<C> ClockSequence for AssertUnwindSafe<C>
where C: ClockSequence,

Sourceยง

type Output = <C as ClockSequence>::Output

The type of sequence returned by this counter.
Sourceยง

fn generate_sequence( &self, seconds: u64, subsec_nanos: u32, ) -> <AssertUnwindSafe<C> as ClockSequence>::Output โ“˜

Get the next value in the sequence to feed into a timestamp. Read more
Sourceยง

fn generate_timestamp_sequence( &self, seconds: u64, subsec_nanos: u32, ) -> (<AssertUnwindSafe<C> as ClockSequence>::Output, u64, u32)

Get the next value in the sequence, potentially also adjusting the timestamp. Read more
Sourceยง

fn usable_bits(&self) -> usize

The number of usable bits from the least significant bit in the result of ClockSequence::generate_sequence or ClockSequence::generate_timestamp_sequence. Read more
1.16.0 ยท Sourceยง

impl<T> Debug for AssertUnwindSafe<T>
where T: Debug,

Sourceยง

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
1.62.0 ยท Sourceยง

impl<T> Default for AssertUnwindSafe<T>
where T: Default,

Sourceยง

fn default() -> AssertUnwindSafe<T> โ“˜

Returns the โ€œdefault valueโ€ for a type. Read more
1.9.0 ยท Sourceยง

impl<T> Deref for AssertUnwindSafe<T>

Sourceยง

type Target = T

The resulting type after dereferencing.
Sourceยง

fn deref(&self) -> &T

Dereferences the value.
1.9.0 ยท Sourceยง

impl<T> DerefMut for AssertUnwindSafe<T>

Sourceยง

fn deref_mut(&mut self) -> &mut T

Mutably dereferences the value.
1.9.0 ยท Sourceยง

impl<R, F> FnOnce() for AssertUnwindSafe<F>
where F: FnOnce() -> R,

Sourceยง

type Output = R

The returned type after the call operator is used.
Sourceยง

extern "rust-call" fn call_once(self, _args: ()) -> R

๐Ÿ”ฌThis is a nightly-only experimental API. (fn_traits)
Performs the call operation.
ยง

impl<F> FusedFuture for AssertUnwindSafe<F>
where F: FusedFuture,

ยง

fn is_terminated(&self) -> bool

Returns true if the underlying future should no longer be polled.
1.36.0 ยท Sourceยง

impl<F> Future for AssertUnwindSafe<F>
where F: Future,

Sourceยง

type Output = <F as Future>::Output

The type of value produced on completion.
Sourceยง

fn poll( self: Pin<&mut AssertUnwindSafe<F>>, cx: &mut Context<'_>, ) -> Poll<<AssertUnwindSafe<F> as Future>::Output>

Attempts to resolve the future to a final value, registering the current task for wakeup if the value is not yet available. Read more
ยง

impl<S> Stream for AssertUnwindSafe<S>
where S: Stream,

ยง

type Item = <S as Stream>::Item

Values yielded by the stream.
ยง

fn poll_next( self: Pin<&mut AssertUnwindSafe<S>>, cx: &mut Context<'_>, ) -> Poll<Option<<S as Stream>::Item>>

Attempt to pull out the next value of this stream, registering the current task for wakeup if the value is not yet available, and returning None if the stream is exhausted. Read more
ยง

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the stream. Read more
1.9.0 ยท Sourceยง

impl<T> RefUnwindSafe for AssertUnwindSafe<T>

1.9.0 ยท Sourceยง

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
where A: Access<T> + ?Sized, P: Deref<Target = A>,

ยง

type Guard = <A as Access<T>>::Guard

A guard object containing the value and keeping it alive. Read more
ยง

fn load(&self) -> <P as Access<T>>::Guard

The loading method. Read more
Sourceยง

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where 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) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Sourceยง

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
ยง

impl<T> ArchivePointee for T

ยง

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
ยง

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Sourceยง

impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Sourceยง

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Sourceยง

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Sourceยง

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Sourceยง

impl<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Sourceยง

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type thatโ€™s used in parameters when converting.
Sourceยง

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
ยง

impl<Func, T> ComponentConstructor<(), T> for Func
where Func: FnOnce() -> T,

ยง

fn construct(self, _: ()) -> T

Sourceยง

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Sourceยง

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
ยง

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

ยง

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
ยง

impl<T> Downcast for T
where T: Any,

ยง

fn into_any(self: Box<T>) -> Box<dyn Any>

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

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

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

Converts &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
where T: Any + Send,

ยง

fn into_any_send(self: Box<T>) -> Box<dyn Any + Send>

Converts Box<Trait> (where Trait: DowncastSend) to Box<dyn Any + Send>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
ยง

impl<T> DowncastSync for T
where T: Any + Send + Sync,

ยง

fn into_any_sync(self: Box<T>) -> Box<dyn Any + Send + Sync>

Converts Box<Trait> (where Trait: DowncastSync) to Box<dyn Any + Send + Sync>, which can then be downcast into Box<ConcreteType> where ConcreteType implements Trait.
ยง

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Converts Arc<Trait> (where Trait: DowncastSync) to Arc<Any>, which can then be downcast into Arc<ConcreteType> where ConcreteType implements Trait.
ยง

impl<T, A> DynAccess<T> for A
where A: Access<T>, <A as Access<T>>::Guard: 'static,

ยง

fn load(&self) -> DynGuard<T>

The equivalent of [Access::load].
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> FromAngle<T> for T

Sourceยง

fn from_angle(angle: T) -> T

Performs a conversion from angle.
ยง

impl<E, T, Request, Encoding> FromReq<Patch<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request, Encoding> FromReq<Post<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, T, Request, Encoding> FromReq<Put<Encoding>, Request, E> for T
where Request: Req<E> + Send + 'static, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_req(req: Request) -> Result<T, E>

Attempts to deserialize the arguments from a request.
ยง

impl<E, Encoding, Response, T> FromRes<Patch<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
ยง

impl<E, Encoding, Response, T> FromRes<Post<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
ยง

impl<E, Encoding, Response, T> FromRes<Put<Encoding>, Response, E> for T
where Response: ClientRes<E> + Send, Encoding: Decodes<T>, E: FromServerFnError,

ยง

async fn from_res(res: Response) -> Result<T, E>

Attempts to deserialize the outputs from a response.
Sourceยง

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Sourceยง

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
ยง

impl<T> FutureExt for T
where T: Future + ?Sized,

ยง

fn map<U, F>(self, f: F) -> Map<Self, F> โ“˜
where F: FnOnce(Self::Output) -> U, Self: Sized,

Map this futureโ€™s output to a different type, returning a new future of the resulting type. Read more
ยง

fn map_into<U>(self) -> MapInto<Self, U> โ“˜
where Self::Output: Into<U>, Self: Sized,

Map this futureโ€™s output to a different type, returning a new future of the resulting type. Read more
ยง

fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F> โ“˜
where F: FnOnce(Self::Output) -> Fut, Fut: Future, Self: Sized,

Chain on a computation for when a future finished, passing the result of the future to the provided closure f. Read more
ยง

fn left_future<B>(self) -> Either<Self, B> โ“˜
where B: Future<Output = Self::Output>, Self: Sized,

Wrap this future in an Either future, making it the left-hand variant of that Either. Read more
ยง

fn right_future<A>(self) -> Either<A, Self> โ“˜
where A: Future<Output = Self::Output>, Self: Sized,

Wrap this future in an Either future, making it the right-hand variant of that Either. Read more
ยง

fn into_stream(self) -> IntoStream<Self>
where Self: Sized,

Convert this future into a single element stream. Read more
ยง

fn flatten(self) -> Flatten<Self> โ“˜
where Self::Output: Future, Self: Sized,

Flatten the execution of this future when the output of this future is itself another future. Read more
ยง

fn flatten_stream(self) -> FlattenStream<Self>
where Self::Output: Stream, Self: Sized,

Flatten the execution of this future when the successful result of this future is a stream. Read more
ยง

fn fuse(self) -> Fuse<Self> โ“˜
where Self: Sized,

Fuse a future such that 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> โ“˜
where F: FnOnce(&Self::Output), Self: Sized,

Do something with the output of a future before passing it on. Read more
ยง

fn catch_unwind(self) -> CatchUnwind<Self> โ“˜
where Self: Sized + UnwindSafe,

Catches unwinding panics while polling the future. Read more
ยง

fn shared(self) -> Shared<Self> โ“˜
where Self: Sized, Self::Output: Clone,

Create a cloneable handle to this future where all handles will resolve to the same result. Read more
ยง

fn remote_handle(self) -> (Remote<Self>, RemoteHandle<Self::Output>)
where Self: Sized,

Turn this future into a future that yields () 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>>
where Self: Sized + Send + 'a,

Wrap the future in a Box, pinning it. Read more
ยง

fn boxed_local<'a>(self) -> Pin<Box<dyn Future<Output = Self::Output> + 'a>>
where Self: Sized + 'a,

Wrap the future in a Box, pinning it. Read more
ยง

fn unit_error(self) -> UnitError<Self> โ“˜
where Self: Sized,

ยง

fn never_error(self) -> NeverError<Self> โ“˜
where Self: Sized,

ยง

fn poll_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Self::Output>
where Self: Unpin,

A convenience for calling Future::poll on Unpin future types.
ยง

fn now_or_never(self) -> Option<Self::Output>
where Self: Sized,

Evaluates and consumes the future, returning the resulting output if the future is ready after the first call to Future::poll. Read more
ยง

impl<T> FutureExt for T
where T: Future + ?Sized,

ยง

fn with_cancellation_token( self, cancellation_token: &CancellationToken, ) -> WithCancellationTokenFuture<'_, Self>
where Self: Sized,

Similar to [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,

Similar to [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

ยง

fn instrument(self, span: Span) -> Instrumented<Self> โ“˜

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
ยง

fn in_current_span(self) -> Instrumented<Self> โ“˜

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T, U> IntoAngle<U> for T
where U: FromAngle<T>,

Sourceยง

fn into_angle(self) -> U

Performs a conversion into T.
Sourceยง

impl<I> IntoAsyncIterator for I
where I: AsyncIterator,

Sourceยง

type Item = <I as AsyncIterator>::Item

๐Ÿ”ฌThis is a nightly-only experimental API. (async_iterator)
The type of the item yielded by the iterator
Sourceยง

type IntoAsyncIter = I

๐Ÿ”ฌThis is a nightly-only experimental API. (async_iterator)
The type of the resulting iterator
Sourceยง

fn into_async_iter(self) -> <I as IntoAsyncIterator>::IntoAsyncIter

๐Ÿ”ฌThis is a nightly-only experimental API. (async_iterator)
Converts self into an async iterator
Sourceยง

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Sourceยง

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type thatโ€™s used in parameters when converting.
Sourceยง

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Sourceยง

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Sourceยง

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Sourceยง

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Sourceยง

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Sourceยง

impl<T> IntoEither for T

Sourceยง

fn into_either(self, into_left: bool) -> Either<Self, Self> โ“˜

Converts 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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> โ“˜
where F: FnOnce(&Self) -> bool,

Converts 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 more
Sourceยง

impl<F> IntoFuture for F
where F: Future,

Sourceยง

type Output = <F as Future>::Output

The output that the future will produce on completion.
Sourceยง

type IntoFuture = F

Which kind of future are we turning this into?
Sourceยง

fn into_future(self) -> <F as IntoFuture>::IntoFuture

Creates a future from a value. Read more
ยง

impl<E, T, Encoding, Request> IntoReq<Patch<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Encoding, Request> IntoReq<Post<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Encoding, Request> IntoReq<Put<Encoding>, Request, E> for T
where Request: ClientReq<E>, Encoding: Encodes<T>, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Request> IntoReq<Streaming, Request, E> for T
where Request: ClientReq<E>, T: Stream<Item = Bytes> + Send + 'static, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, T, Request> IntoReq<StreamingText, Request, E> for T
where Request: ClientReq<E>, T: Into<TextStream<E>>, E: FromServerFnError,

ยง

fn into_req(self, path: &str, accepts: &str) -> Result<Request, E>

Attempts to serialize the arguments into an HTTP request.
ยง

impl<E, Response, Encoding, T> IntoRes<Patch<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

ยง

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
ยง

impl<E, Response, Encoding, T> IntoRes<Post<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

ยง

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
ยง

impl<E, Response, Encoding, T> IntoRes<Put<Encoding>, Response, E> for T
where Response: TryRes<E>, Encoding: Encodes<T>, E: FromServerFnError + Send, T: Send,

ยง

async fn into_res(self) -> Result<Response, E>

Attempts to serialize the output into an HTTP response.
Sourceยง

impl<T> IntoStimulus<T> for T

Sourceยง

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
ยง

impl<T> Pointable for T

ยง

const ALIGN: usize

The alignment of pointer.
ยง

type Init = T

The type for initializers.
ยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
ยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
ยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
ยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
ยง

impl<T> Pointee for T

ยง

type Metadata = ()

The type for metadata in pointers and references to Self.
ยง

impl<T> PolicyExt for T
where T: ?Sized,

ยง

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] only if self and other return Action::Follow. Read more
ยง

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns [Action::Follow] if either self or other returns Action::Follow. Read more
Sourceยง

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Sourceยง

type Target = T

๐Ÿ”ฌThis is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Sourceยง

impl<R> Rng for R
where R: RngCore + ?Sized,

Sourceยง

fn random<T>(&mut self) -> T

Return a random value via the StandardUniform distribution. Read more
Sourceยง

fn random_iter<T>(self) -> Iter<StandardUniform, Self, T> โ“˜

Return an iterator over random variates Read more
Sourceยง

fn random_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

Generate a random value in the given range. Read more
Sourceยง

fn random_bool(&mut self, p: f64) -> bool

Return a bool with a probability p of being true. Read more
Sourceยง

fn random_ratio(&mut self, numerator: u32, denominator: u32) -> bool

Return a bool with a probability of numerator/denominator of being true. Read more
Sourceยง

fn sample<T, D>(&mut self, distr: D) -> T
where D: Distribution<T>,

Sample a new value, using the given distribution. Read more
Sourceยง

fn sample_iter<T, D>(self, distr: D) -> Iter<D, Self, T> โ“˜
where D: Distribution<T>, Self: Sized,

Create an iterator that generates values using the given distribution. Read more
Sourceยง

fn fill<T>(&mut self, dest: &mut T)
where T: Fill + ?Sized,

Fill any type implementing Fill with random data Read more
Sourceยง

fn gen<T>(&mut self) -> T

๐Ÿ‘ŽDeprecated since 0.9.0: Renamed to random to avoid conflict with the new gen keyword in Rust 2024.
Alias for Rng::random.
Sourceยง

fn gen_range<T, R>(&mut self, range: R) -> T
where T: SampleUniform, R: SampleRange<T>,

๐Ÿ‘ŽDeprecated since 0.9.0: Renamed to random_range
Sourceยง

fn gen_bool(&mut self, p: f64) -> bool

๐Ÿ‘ŽDeprecated since 0.9.0: Renamed to random_bool
Alias for Rng::random_bool.
Sourceยง

fn gen_ratio(&mut self, numerator: u32, denominator: u32) -> bool

๐Ÿ‘ŽDeprecated since 0.9.0: Renamed to random_ratio
Sourceยง

impl<T> RngCore for T
where T: DerefMut, <T as Deref>::Target: RngCore,

Sourceยง

fn next_u32(&mut self) -> u32

Return the next random u32. Read more
Sourceยง

fn next_u64(&mut self) -> u64

Return the next random u64. Read more
Sourceยง

fn fill_bytes(&mut self, dst: &mut [u8])

Fill dest with random data. Read more
Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
ยง

impl<T> SerializableKey for T

ยง

fn ser_key(&self) -> String

Serializes the key to a unique string. Read more
ยง

impl<T> StorageAccess<T> for T

ยง

fn as_borrowed(&self) -> &T

Borrows the value.
ยง

fn into_taken(self) -> T

Takes the value.
ยง

impl<St> StreamExt for St
where St: Stream + ?Sized,

ยง

fn next(&mut self) -> Next<'_, Self>
where Self: Unpin,

Consumes and returns the next value in the stream or None if the stream is finished. Read more
ยง

fn try_next<T, E>(&mut self) -> TryNext<'_, Self>
where Self: Stream<Item = Result<T, E>> + Unpin,

Consumes and returns the next item in the stream. If an error is encountered before the next item, the error is returned instead. Read more
ยง

fn map<T, F>(self, f: F) -> Map<Self, F>
where F: FnMut(Self::Item) -> T, Self: Sized,

Maps this streamโ€™s items to a different type, returning a new stream of the resulting type. Read more
ยง

fn map_while<T, F>(self, f: F) -> MapWhile<Self, F>
where F: FnMut(Self::Item) -> Option<T>, Self: Sized,

Map this streamโ€™s items to a different type for as long as determined by the provided closure. A stream of the target type will be returned, which will yield elements until the closure returns None. Read more
ยง

fn then<F, Fut>(self, f: F) -> Then<Self, Fut, F>
where F: FnMut(Self::Item) -> Fut, Fut: Future, Self: Sized,

Maps this streamโ€™s items asynchronously to a different type, returning a new stream of the resulting type. Read more
ยง

fn merge<U>(self, other: U) -> Merge<Self, U>
where U: Stream<Item = Self::Item>, Self: Sized,

Combine two streams into one by interleaving the output of both as it is produced. Read more
ยง

fn filter<F>(self, f: F) -> Filter<Self, F>
where F: FnMut(&Self::Item) -> bool, Self: Sized,

Filters the values produced by this stream according to the provided predicate. Read more
ยง

fn filter_map<T, F>(self, f: F) -> FilterMap<Self, F>
where F: FnMut(Self::Item) -> Option<T>, Self: Sized,

Filters the values produced by this stream while simultaneously mapping them to a different type according to the provided closure. Read more
ยง

fn fuse(self) -> Fuse<Self>
where Self: Sized,

Creates a stream which ends after the first None. Read more
ยง

fn take(self, n: usize) -> Take<Self>
where Self: Sized,

Creates a new stream of at most n items of the underlying stream. Read more
ยง

fn take_while<F>(self, f: F) -> TakeWhile<Self, F>
where F: FnMut(&Self::Item) -> bool, Self: Sized,

Take elements from this stream while the provided predicate resolves to true. Read more
ยง

fn skip(self, n: usize) -> Skip<Self>
where Self: Sized,

Creates a new stream that will skip the n first items of the underlying stream. Read more
ยง

fn skip_while<F>(self, f: F) -> SkipWhile<Self, F>
where F: FnMut(&Self::Item) -> bool, Self: Sized,

Skip elements from the underlying stream while the provided predicate resolves to true. Read more
ยง

fn all<F>(&mut self, f: F) -> AllFuture<'_, Self, F>
where Self: Unpin, F: FnMut(Self::Item) -> bool,

Tests if every element of the stream matches a predicate. Read more
ยง

fn any<F>(&mut self, f: F) -> AnyFuture<'_, Self, F>
where Self: Unpin, F: FnMut(Self::Item) -> bool,

Tests if any element of the stream matches a predicate. Read more
ยง

fn chain<U>(self, other: U) -> Chain<Self, U>
where U: Stream<Item = Self::Item>, Self: Sized,

Combine two streams into one by first returning all values from the first stream then all values from the second stream. Read more
ยง

fn fold<B, F>(self, init: B, f: F) -> FoldFuture<Self, B, F>
where Self: Sized, F: FnMut(B, Self::Item) -> B,

A combinator that applies a function to every element in a stream producing a single, final value. Read more
ยง

fn collect<T>(self) -> Collect<Self, T>
where T: FromStream<Self::Item>, Self: Sized,

Drain stream pushing all emitted values into a collection. Read more
ยง

fn timeout(self, duration: Duration) -> Timeout<Self>
where Self: Sized,

Applies a per-item timeout to the passed stream. Read more
ยง

fn timeout_repeating(self, interval: Interval) -> TimeoutRepeating<Self>
where Self: Sized,

Applies a per-item timeout to the passed stream. Read more
ยง

fn throttle(self, duration: Duration) -> Throttle<Self>
where Self: Sized,

Slows down a stream by enforcing a delay between items. Read more
ยง

fn chunks_timeout( self, max_size: usize, duration: Duration, ) -> ChunksTimeout<Self>
where Self: Sized,

Batches the items in the given stream using a maximum duration and size for each batch. Read more
ยง

fn peekable(self) -> Peekable<Self>
where Self: Sized,

Turns the stream into a peekable stream, whose next element can be peeked at without being consumed. Read more
ยง

impl<T> StreamExt for T
where T: Stream + ?Sized,

ยง

fn next(&mut self) -> Next<'_, Self> โ“˜
where Self: Unpin,

Creates a future that resolves to the next item in the stream. Read more
ยง

fn into_future(self) -> StreamFuture<Self> โ“˜
where Self: Sized + Unpin,

Converts this stream into a future of (next_item, tail_of_stream). If the stream terminates, then the next item is None. Read more
ยง

fn map<T, F>(self, f: F) -> Map<Self, F>
where F: FnMut(Self::Item) -> T, Self: Sized,

Maps this streamโ€™s items to a different type, returning a new stream of the resulting type. Read more
ยง

fn enumerate(self) -> Enumerate<Self>
where Self: Sized,

Creates a stream which gives the current iteration count as well as the next value. Read more
ยง

fn filter<Fut, F>(self, f: F) -> Filter<Self, Fut, F>
where F: FnMut(&Self::Item) -> Fut, Fut: Future<Output = bool>, Self: Sized,

Filters the values produced by this stream according to the provided asynchronous predicate. Read more
ยง

fn filter_map<Fut, T, F>(self, f: F) -> FilterMap<Self, Fut, F>
where F: FnMut(Self::Item) -> Fut, Fut: Future<Output = Option<T>>, Self: Sized,

Filters the values produced by this stream while simultaneously mapping them to a different type according to the provided asynchronous closure. Read more
ยง

fn then<Fut, F>(self, f: F) -> Then<Self, Fut, F>
where F: FnMut(Self::Item) -> Fut, Fut: Future, Self: Sized,

Computes from this streamโ€™s items new items of a different type using an asynchronous closure. Read more
ยง

fn collect<C>(self) -> Collect<Self, C> โ“˜
where C: Default + Extend<Self::Item>, Self: Sized,

Transforms a stream into a collection, returning a future representing the result of that computation. Read more
ยง

fn unzip<A, B, FromA, FromB>(self) -> Unzip<Self, FromA, FromB> โ“˜
where FromA: Default + Extend<A>, FromB: Default + Extend<B>, Self: Sized + Stream<Item = (A, B)>,

Converts a stream of pairs into a future, which resolves to pair of containers. Read more
ยง

fn concat(self) -> Concat<Self> โ“˜
where Self: Sized, Self::Item: Extend<<Self::Item as IntoIterator>::Item> + IntoIterator + Default,

Concatenate all items of a stream into a single extendable destination, returning a future representing the end result. Read more
ยง

fn count(self) -> Count<Self> โ“˜
where Self: Sized,

Drives the stream to completion, counting the number of items. Read more
ยง

fn cycle(self) -> Cycle<Self>
where Self: Sized + Clone,

Repeats a stream endlessly. Read more
ยง

fn fold<T, Fut, F>(self, init: T, f: F) -> Fold<Self, Fut, T, F> โ“˜
where F: FnMut(T, Self::Item) -> Fut, Fut: Future<Output = T>, Self: Sized,

Execute an accumulating asynchronous computation over a stream, collecting all the values into one final result. Read more
ยง

fn any<Fut, F>(self, f: F) -> Any<Self, Fut, F> โ“˜
where F: FnMut(Self::Item) -> Fut, Fut: Future<Output = bool>, Self: Sized,

Execute predicate over asynchronous stream, and return true if any element in stream satisfied a predicate. Read more
ยง

fn all<Fut, F>(self, f: F) -> All<Self, Fut, F> โ“˜
where F: FnMut(Self::Item) -> Fut, Fut: Future<Output = bool>, Self: Sized,

Execute predicate over asynchronous stream, and return true if all element in stream satisfied a predicate. Read more
ยง

fn flatten(self) -> Flatten<Self>
where Self::Item: Stream, Self: Sized,

Flattens a stream of streams into just one continuous stream. Read more
ยง

fn flatten_unordered( self, limit: impl Into<Option<usize>>, ) -> FlattenUnorderedWithFlowController<Self, ()>
where Self::Item: Stream + Unpin, Self: Sized,

Flattens a stream of streams into just one continuous stream. Polls inner streams produced by the base stream concurrently. Read more
ยง

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where F: FnMut(Self::Item) -> U, U: Stream, Self: Sized,

Maps a stream like [StreamExt::map] but flattens nested Streams. Read more
ยง

fn flat_map_unordered<U, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> FlatMapUnordered<Self, U, F>
where U: Stream + Unpin, F: FnMut(Self::Item) -> U, Self: Sized,

Maps a stream like [StreamExt::map] but flattens nested Streams 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>
where F: FnMut(&mut S, Self::Item) -> Fut, Fut: Future<Output = Option<B>>, Self: Sized,

Combinator similar to [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>
where F: FnMut(&Self::Item) -> Fut, Fut: Future<Output = bool>, Self: Sized,

Skip elements on this stream while the provided asynchronous predicate resolves to true. Read more
ยง

fn take_while<Fut, F>(self, f: F) -> TakeWhile<Self, Fut, F>
where F: FnMut(&Self::Item) -> Fut, Fut: Future<Output = bool>, Self: Sized,

Take elements from this stream while the provided asynchronous predicate resolves to true. Read more
ยง

fn take_until<Fut>(self, fut: Fut) -> TakeUntil<Self, Fut>
where Fut: Future, Self: Sized,

Take elements from this stream until the provided future resolves. Read more
ยง

fn for_each<Fut, F>(self, f: F) -> ForEach<Self, Fut, F> โ“˜
where F: FnMut(Self::Item) -> Fut, Fut: Future<Output = ()>, Self: Sized,

Runs this stream to completion, executing the provided asynchronous closure for each element on the stream. Read more
ยง

fn for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> ForEachConcurrent<Self, Fut, F> โ“˜
where F: FnMut(Self::Item) -> Fut, Fut: Future<Output = ()>, Self: Sized,

Runs this stream to completion, executing the provided asynchronous closure for each element on the stream concurrently as elements become available. Read more
ยง

fn take(self, n: usize) -> Take<Self>
where Self: Sized,

Creates a new stream of at most n items of the underlying stream. Read more
ยง

fn skip(self, n: usize) -> Skip<Self>
where Self: Sized,

Creates a new stream which skips n items of the underlying stream. Read more
ยง

fn fuse(self) -> Fuse<Self>
where Self: Sized,

Fuse a stream such that poll_next will never again be called once it has finished. This method can be used to turn any Stream into a FusedStream. Read more
ยง

fn by_ref(&mut self) -> &mut Self

Borrows a stream, rather than consuming it. Read more
ยง

fn catch_unwind(self) -> CatchUnwind<Self>
where Self: Sized + UnwindSafe,

Catches unwinding panics while polling the stream. Read more
ยง

fn boxed<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + Send + 'a>>
where Self: Sized + Send + 'a,

Wrap the stream in a Box, pinning it. Read more
ยง

fn boxed_local<'a>(self) -> Pin<Box<dyn Stream<Item = Self::Item> + 'a>>
where Self: Sized + 'a,

Wrap the stream in a Box, pinning it. Read more
ยง

fn buffered(self, n: usize) -> Buffered<Self>
where Self::Item: Future, Self: Sized,

An adaptor for creating a buffered list of pending futures. Read more
ยง

fn buffer_unordered(self, n: usize) -> BufferUnordered<Self>
where Self::Item: Future, Self: Sized,

An adaptor for creating a buffered list of pending futures (unordered). Read more
ยง

fn zip<St>(self, other: St) -> Zip<Self, St>
where St: Stream, Self: Sized,

An adapter for zipping two streams together. Read more
ยง

fn chain<St>(self, other: St) -> Chain<Self, St>
where St: Stream<Item = Self::Item>, Self: Sized,

Adapter for chaining two streams. Read more
ยง

fn peekable(self) -> Peekable<Self>
where Self: Sized,

Creates a new stream which exposes a peek method. Read more
ยง

fn chunks(self, capacity: usize) -> Chunks<Self>
where Self: Sized,

An adaptor for chunking up items of the stream inside a vector. Read more
ยง

fn ready_chunks(self, capacity: usize) -> ReadyChunks<Self>
where Self: Sized,

An adaptor for chunking up ready items of the stream inside a vector. Read more
ยง

fn forward<S>(self, sink: S) -> Forward<Self, S> โ“˜
where S: Sink<Self::Ok, Error = Self::Error>, Self: Sized + TryStream,

A future that completes after the given stream has been fully processed into the sink and the sink has been flushed and closed. Read more
ยง

fn split<Item>(self) -> (SplitSink<Self, Item>, SplitStream<Self>)
where Self: Sized + Sink<Item>,

Splits this Stream + Sink object into separate Sink and Stream objects. Read more
ยง

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where F: FnMut(&Self::Item), Self: Sized,

Do something with each item of this stream, afterwards passing it on. Read more
ยง

fn left_stream<B>(self) -> Either<Self, B> โ“˜
where B: Stream<Item = Self::Item>, Self: Sized,

Wrap this stream in an Either stream, making it the left-hand variant of that Either. Read more
ยง

fn right_stream<B>(self) -> Either<B, Self> โ“˜
where B: Stream<Item = Self::Item>, Self: Sized,

Wrap this stream in an Either stream, making it the right-hand variant of that Either. Read more
ยง

fn poll_next_unpin(&mut self, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>
where Self: Unpin,

A convenience method for calling [Stream::poll_next] on Unpin stream types.
ยง

fn select_next_some(&mut self) -> SelectNextSome<'_, Self> โ“˜
where Self: Unpin + FusedStream,

Returns a Future that resolves when the next item in this stream is ready. Read more
Sourceยง

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Sourceยง

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Sourceยง

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. Read more
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
ยง

impl<F, T, E> TryFuture for F
where F: Future<Output = Result<T, E>> + ?Sized,

ยง

type Ok = T

The type of successful values yielded by this future
ยง

type Error = E

The type of failures yielded by this future
ยง

fn try_poll( self: Pin<&mut F>, cx: &mut Context<'_>, ) -> Poll<<F as Future>::Output>

Poll this TryFuture as if it were a Future. Read more
ยง

impl<Fut> TryFutureExt for Fut
where Fut: TryFuture + ?Sized,

ยง

fn flatten_sink<Item>(self) -> FlattenSink<Self, Self::Ok>
where Self::Ok: Sink<Item, Error = Self::Error>, Self: Sized,

Flattens the execution of this future when the successful result of this future is a [Sink]. Read more
ยง

fn map_ok<T, F>(self, f: F) -> MapOk<Self, F> โ“˜
where F: FnOnce(Self::Ok) -> T, Self: Sized,

Maps this futureโ€™s success value to a different value. Read more
ยง

fn map_ok_or_else<T, E, F>(self, e: E, f: F) -> MapOkOrElse<Self, F, E> โ“˜
where F: FnOnce(Self::Ok) -> T, E: FnOnce(Self::Error) -> T, Self: Sized,

Maps this futureโ€™s success value to a different value, and permits for error handling resulting in the same type. Read more
ยง

fn map_err<E, F>(self, f: F) -> MapErr<Self, F> โ“˜
where F: FnOnce(Self::Error) -> E, Self: Sized,

Maps this futureโ€™s error value to a different value. Read more
ยง

fn err_into<E>(self) -> ErrInto<Self, E> โ“˜
where Self: Sized, Self::Error: Into<E>,

Maps this futureโ€™s Error to a new error type using the Into trait. Read more
ยง

fn ok_into<U>(self) -> OkInto<Self, U> โ“˜
where Self: Sized, Self::Ok: Into<U>,

Maps this futureโ€™s Ok to a new type using the Into trait.
ยง

fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F> โ“˜
where F: FnOnce(Self::Ok) -> Fut, Fut: TryFuture<Error = Self::Error>, Self: Sized,

Executes another future after this one resolves successfully. The success value is passed to a closure to create this subsequent future. Read more
ยง

fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F> โ“˜
where F: FnOnce(Self::Error) -> Fut, Fut: TryFuture<Ok = Self::Ok>, Self: Sized,

Executes another future if this one resolves to an error. The error value is passed to a closure to create this subsequent future. Read more
ยง

fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F> โ“˜
where F: FnOnce(&Self::Ok), Self: Sized,

Do something with the success value of a future before passing it on. Read more
ยง

fn inspect_err<F>(self, f: F) -> InspectErr<Self, F> โ“˜
where F: FnOnce(&Self::Error), Self: Sized,

Do something with the error value of a future before passing it on. Read more
ยง

fn try_flatten(self) -> TryFlatten<Self, Self::Ok> โ“˜
where Self::Ok: TryFuture<Error = Self::Error>, Self: Sized,

Flatten the execution of this future when the successful result of this future is another future. Read more
ยง

fn try_flatten_stream(self) -> TryFlattenStream<Self>
where Self::Ok: TryStream<Error = Self::Error>, Self: Sized,

Flatten the execution of this future when the successful result of this future is a stream. Read more
ยง

fn unwrap_or_else<F>(self, f: F) -> UnwrapOrElse<Self, F> โ“˜
where Self: Sized, F: FnOnce(Self::Error) -> Self::Ok,

Unwraps this futureโ€™s output, producing a future with this futureโ€™s Ok type as its Output type. Read more
ยง

fn into_future(self) -> IntoFuture<Self> โ“˜
where Self: Sized,

Wraps a [TryFuture] into a type that implements Future. Read more
ยง

fn try_poll_unpin( &mut self, cx: &mut Context<'_>, ) -> Poll<Result<Self::Ok, Self::Error>>
where Self: Unpin,

A convenience method for calling [TryFuture::try_poll] on Unpin future types.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Sourceยง

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Sourceยง

impl<R> TryRngCore for R
where R: RngCore + ?Sized,

Sourceยง

type Error = Infallible

The type returned in the event of a RNG error.
Sourceยง

fn try_next_u32(&mut self) -> Result<u32, <R as TryRngCore>::Error>

Return the next random u32.
Sourceยง

fn try_next_u64(&mut self) -> Result<u64, <R as TryRngCore>::Error>

Return the next random u64.
Sourceยง

fn try_fill_bytes( &mut self, dst: &mut [u8], ) -> Result<(), <R as TryRngCore>::Error>

Fill dest entirely with random data.
Sourceยง

fn unwrap_err(self) -> UnwrapErr<Self>
where Self: Sized,

Wrap RNG with the UnwrapErr wrapper.
Sourceยง

fn unwrap_mut(&mut self) -> UnwrapMut<'_, Self>

Wrap RNG with the UnwrapMut wrapper.
Sourceยง

fn read_adapter(&mut self) -> RngReadAdapter<'_, Self>
where Self: Sized,

Convert an RngCore to a RngReadAdapter.
ยง

impl<S, T, E> TryStream for S
where S: Stream<Item = Result<T, E>> + ?Sized,

ยง

type Ok = T

The type of successful values yielded by this future
ยง

type Error = E

The type of failures yielded by this future
ยง

fn try_poll_next( self: Pin<&mut S>, cx: &mut Context<'_>, ) -> Poll<Option<Result<<S as TryStream>::Ok, <S as TryStream>::Error>>>

Poll this TryStream as if it were a Stream. Read more
ยง

impl<S> TryStreamExt for S
where S: TryStream + ?Sized,

ยง

fn err_into<E>(self) -> ErrInto<Self, E>
where Self: Sized, Self::Error: Into<E>,

Wraps the current stream in a new stream which converts the error type into the one provided. Read more
ยง

fn map_ok<T, F>(self, f: F) -> MapOk<Self, F>
where Self: Sized, F: FnMut(Self::Ok) -> T,

Wraps the current stream in a new stream which maps the success value using the provided closure. Read more
ยง

fn map_err<E, F>(self, f: F) -> MapErr<Self, F>
where Self: Sized, F: FnMut(Self::Error) -> E,

Wraps the current stream in a new stream which maps the error value using the provided closure. Read more
ยง

fn and_then<Fut, F>(self, f: F) -> AndThen<Self, Fut, F>
where F: FnMut(Self::Ok) -> Fut, Fut: TryFuture<Error = Self::Error>, Self: Sized,

Chain on a computation for when a value is ready, passing the successful results to the provided closure f. Read more
ยง

fn or_else<Fut, F>(self, f: F) -> OrElse<Self, Fut, F>
where F: FnMut(Self::Error) -> Fut, Fut: TryFuture<Ok = Self::Ok>, Self: Sized,

Chain on a computation for when an error happens, passing the erroneous result to the provided closure f. Read more
ยง

fn inspect_ok<F>(self, f: F) -> InspectOk<Self, F>
where F: FnMut(&Self::Ok), Self: Sized,

Do something with the success value of this stream, afterwards passing it on. Read more
ยง

fn inspect_err<F>(self, f: F) -> InspectErr<Self, F>
where F: FnMut(&Self::Error), Self: Sized,

Do something with the error value of this stream, afterwards passing it on. Read more
ยง

fn into_stream(self) -> IntoStream<Self>
where Self: Sized,

Wraps a [TryStream] into a type that implements Stream Read more
ยง

fn try_next(&mut self) -> TryNext<'_, Self> โ“˜
where Self: Unpin,

Creates a future that attempts to resolve the next item in the stream. If an error is encountered before the next item, the error is returned instead. Read more
ยง

fn try_for_each<Fut, F>(self, f: F) -> TryForEach<Self, Fut, F> โ“˜
where F: FnMut(Self::Ok) -> Fut, Fut: TryFuture<Ok = (), Error = Self::Error>, Self: Sized,

Attempts to run this stream to completion, executing the provided asynchronous closure for each element on the stream. Read more
ยง

fn try_skip_while<Fut, F>(self, f: F) -> TrySkipWhile<Self, Fut, F>
where F: FnMut(&Self::Ok) -> Fut, Fut: TryFuture<Ok = bool, Error = Self::Error>, Self: Sized,

Skip elements on this stream while the provided asynchronous predicate resolves to true. Read more
ยง

fn try_take_while<Fut, F>(self, f: F) -> TryTakeWhile<Self, Fut, F>
where F: FnMut(&Self::Ok) -> Fut, Fut: TryFuture<Ok = bool, Error = Self::Error>, Self: Sized,

Take elements on this stream while the provided asynchronous predicate resolves to true. Read more
ยง

fn try_for_each_concurrent<Fut, F>( self, limit: impl Into<Option<usize>>, f: F, ) -> TryForEachConcurrent<Self, Fut, F> โ“˜
where F: FnMut(Self::Ok) -> Fut, Fut: Future<Output = Result<(), Self::Error>>, Self: Sized,

Attempts to run this stream to completion, executing the provided asynchronous closure for each element on the stream concurrently as elements become available, exiting as soon as an error occurs. Read more
ยง

fn try_collect<C>(self) -> TryCollect<Self, C> โ“˜
where C: Default + Extend<Self::Ok>, Self: Sized,

Attempt to transform a stream into a collection, returning a future representing the result of that computation. Read more
ยง

fn try_chunks(self, capacity: usize) -> TryChunks<Self>
where Self: Sized,

An adaptor for chunking up successful items of the stream inside a vector. Read more
ยง

fn try_ready_chunks(self, capacity: usize) -> TryReadyChunks<Self>
where Self: Sized,

An adaptor for chunking up successful, ready items of the stream inside a vector. Read more
ยง

fn try_filter<Fut, F>(self, f: F) -> TryFilter<Self, Fut, F>
where Fut: Future<Output = bool>, F: FnMut(&Self::Ok) -> Fut, Self: Sized,

Attempt to filter the values produced by this stream according to the provided asynchronous closure. Read more
ยง

fn try_filter_map<Fut, F, T>(self, f: F) -> TryFilterMap<Self, Fut, F>
where Fut: TryFuture<Ok = Option<T>, Error = Self::Error>, F: FnMut(Self::Ok) -> Fut, Self: Sized,

Attempt to filter the values produced by this stream while simultaneously mapping them to a different type according to the provided asynchronous closure. Read more
ยง

fn try_flatten_unordered( self, limit: impl Into<Option<usize>>, ) -> TryFlattenUnordered<Self>
where Self::Ok: TryStream + Unpin, <Self::Ok as TryStream>::Error: From<Self::Error>, Self: Sized,

Flattens a stream of streams into just one continuous stream. Produced streams will be polled concurrently and any errors will be passed through without looking at them. If the underlying base stream returns an error, it will be immediately propagated. Read more
ยง

fn try_flatten(self) -> TryFlatten<Self>
where Self::Ok: TryStream, <Self::Ok as TryStream>::Error: From<Self::Error>, Self: Sized,

Flattens a stream of streams into just one continuous stream. Read more
ยง

fn try_fold<T, Fut, F>(self, init: T, f: F) -> TryFold<Self, Fut, T, F> โ“˜
where F: FnMut(T, Self::Ok) -> Fut, Fut: TryFuture<Ok = T, Error = Self::Error>, Self: Sized,

Attempt to execute an accumulating asynchronous computation over a stream, collecting all the values into one final result. Read more
ยง

fn try_concat(self) -> TryConcat<Self> โ“˜
where Self: Sized, Self::Ok: Extend<<Self::Ok as IntoIterator>::Item> + IntoIterator + Default,

Attempt to concatenate all items of a stream into a single extendable destination, returning a future representing the end result. Read more
ยง

fn try_buffer_unordered(self, n: usize) -> TryBufferUnordered<Self>
where Self::Ok: TryFuture<Error = Self::Error>, Self: Sized,

Attempt to execute several futures from a stream concurrently (unordered). Read more
ยง

fn try_buffered(self, n: usize) -> TryBuffered<Self>
where Self::Ok: TryFuture<Error = Self::Error>, Self: Sized,

Attempt to execute several futures from a stream concurrently. Read more
ยง

fn try_poll_next_unpin( &mut self, cx: &mut Context<'_>, ) -> Poll<Option<Result<Self::Ok, Self::Error>>>
where Self: Unpin,

A convenience method for calling [TryStream::try_poll_next] on Unpin stream types.
ยง

fn into_async_read(self) -> IntoAsyncRead<Self>
where Self: Sized + TryStreamExt<Error = Error>, Self::Ok: AsRef<[u8]>,

Adapter that converts this stream into an AsyncBufRead. Read more
ยง

fn try_all<Fut, F>(self, f: F) -> TryAll<Self, Fut, F> โ“˜
where Self: Sized, F: FnMut(Self::Ok) -> Fut, Fut: Future<Output = bool>,

Attempt to execute a predicate over an asynchronous stream and evaluate if all items satisfy the predicate. Exits early if an Err is encountered or if an Ok item is found that does not satisfy the predicate. Read more
ยง

fn try_any<Fut, F>(self, f: F) -> TryAny<Self, Fut, F> โ“˜
where Self: Sized, F: FnMut(Self::Ok) -> Fut, Fut: Future<Output = bool>,

Attempt to execute a predicate over an asynchronous stream and evaluate if any items satisfy the predicate. Exits early if an Err is encountered or if an Ok item is found that satisfies the predicate. Read more
Sourceยง

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Sourceยง

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Sourceยง

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Sourceยง

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
ยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

ยง

fn vzip(self) -> V

ยง

impl<T> WithSubscriber for T

ยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> โ“˜
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

fn with_current_subscriber(self) -> WithDispatch<Self> โ“˜

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

impl<F, R> Component<EmptyPropsBuilder> for F
where F: FnOnce() -> R,

Sourceยง

impl<T> CryptoRng for T
where T: DerefMut, <T as Deref>::Target: CryptoRng,

ยง

impl<T> ErasedDestructor for T
where T: 'static,

ยง

impl<T> Formattable for T
where T: Deref, <T as Deref>::Target: Formattable,

ยง

impl<T> Fruit for T
where T: Send + Downcast,

ยง

impl<T> Parsable for T
where T: Deref, <T as Deref>::Target: Parsable,

Sourceยง

impl<R> TryCryptoRng for R
where R: CryptoRng + ?Sized,