#[repr(transparent)]
pub struct Pin<P> { /* private fields */ }
Expand description

A pinned pointer.

This is a wrapper around a kind of pointer which makes that pointer “pin” its value in place, preventing the value referenced by that pointer from being moved unless it implements Unpin.

See the pin module documentation for an explanation of pinning.

Implementations

Construct a new Pin<P> around a pointer to some data of a type that implements Unpin.

Unlike Pin::new_unchecked, this method is safe because the pointer P dereferences to an Unpin type, which cancels the pinning guarantees.

Unwraps this Pin<P> returning the underlying pointer.

This requires that the data inside this Pin is Unpin so that we can ignore the pinning invariants when unwrapping it.

Construct a new Pin<P> around a reference to some data of a type that may or may not implement Unpin.

If pointer dereferences to an Unpin type, Pin::new should be used instead.

Safety

This constructor is unsafe because we cannot guarantee that the data pointed to by pointer is pinned, meaning that the data will not be moved or its storage invalidated until it gets dropped. If the constructed Pin<P> does not guarantee that the data P points to is pinned, that is a violation of the API contract and may lead to undefined behavior in later (safe) operations.

By using this method, you are making a promise about the P::Deref and P::DerefMut implementations, if they exist. Most importantly, they must not move out of their self arguments: Pin::as_mut and Pin::as_ref will call DerefMut::deref_mut and Deref::deref on the pinned pointer and expect these methods to uphold the pinning invariants. Moreover, by calling this method you promise that the reference P dereferences to will not be moved out of again; in particular, it must not be possible to obtain a &mut P::Target and then move out of that reference (using, for example mem::swap).

For example, calling Pin::new_unchecked on an &'a mut T is unsafe because while you are able to pin it for the given lifetime 'a, you have no control over whether it is kept pinned once 'a ends:

use std::mem;
use std::pin::Pin;

fn move_pinned_ref<T>(mut a: T, mut b: T) {
    unsafe {
        let p: Pin<&mut T> = Pin::new_unchecked(&mut a);
        // This should mean the pointee `a` can never move again.
    }
    mem::swap(&mut a, &mut b);
    // The address of `a` changed to `b`'s stack slot, so `a` got moved even
    // though we have previously pinned it! We have violated the pinning API contract.
}

A value, once pinned, must remain pinned forever (unless its type implements Unpin).

Similarly, calling Pin::new_unchecked on an Rc<T> is unsafe because there could be aliases to the same data that are not subject to the pinning restrictions:

use std::rc::Rc;
use std::pin::Pin;

fn move_pinned_rc<T>(mut x: Rc<T>) {
    let pinned = unsafe { Pin::new_unchecked(Rc::clone(&x)) };
    {
        let p: Pin<&T> = pinned.as_ref();
        // This should mean the pointee can never move again.
    }
    drop(pinned);
    let content = Rc::get_mut(&mut x).unwrap();
    // Now, if `x` was the only reference, we have a mutable reference to
    // data that we pinned above, which we could use to move it as we have
    // seen in the previous example. We have violated the pinning API contract.
 }

Gets a pinned shared reference from this pinned pointer.

This is a generic method to go from &Pin<Pointer<T>> to Pin<&T>. It is safe because, as part of the contract of Pin::new_unchecked, the pointee cannot move after Pin<Pointer<T>> got created. “Malicious” implementations of Pointer::Deref are likewise ruled out by the contract of Pin::new_unchecked.

Unwraps this Pin<P> returning the underlying pointer.

Safety

This function is unsafe. You must guarantee that you will continue to treat the pointer P as pinned after you call this function, so that the invariants on the Pin type can be upheld. If the code using the resulting P does not continue to maintain the pinning invariants that is a violation of the API contract and may lead to undefined behavior in later (safe) operations.

If the underlying data is Unpin, Pin::into_inner should be used instead.

Gets a pinned mutable reference from this pinned pointer.

This is a generic method to go from &mut Pin<Pointer<T>> to Pin<&mut T>. It is safe because, as part of the contract of Pin::new_unchecked, the pointee cannot move after Pin<Pointer<T>> got created. “Malicious” implementations of Pointer::DerefMut are likewise ruled out by the contract of Pin::new_unchecked.

This method is useful when doing multiple calls to functions that consume the pinned type.

Example
use std::pin::Pin;

impl Type {
    fn method(self: Pin<&mut Self>) {
        // do something
    }

    fn call_method_twice(mut self: Pin<&mut Self>) {
        // `method` consumes `self`, so reborrow the `Pin<&mut Self>` via `as_mut`.
        self.as_mut().method();
        self.as_mut().method();
    }
}

Assigns a new value to the memory behind the pinned reference.

This overwrites pinned data, but that is okay: its destructor gets run before being overwritten, so no pinning guarantee is violated.

Constructs a new pin by mapping the interior value.

For example, if you wanted to get a Pin of a field of something, you could use this to get access to that field in one line of code. However, there are several gotchas with these “pinning projections”; see the pin module documentation for further details on that topic.

Safety

This function is unsafe. You must guarantee that the data you return will not move so long as the argument value does not move (for example, because it is one of the fields of that value), and also that you do not move out of the argument you receive to the interior function.

Gets a shared reference out of a pin.

This is safe because it is not possible to move out of a shared reference. It may seem like there is an issue here with interior mutability: in fact, it is possible to move a T out of a &RefCell<T>. However, this is not a problem as long as there does not also exist a Pin<&T> pointing to the same data, and RefCell<T> does not let you create a pinned reference to its contents. See the discussion on “pinning projections” for further details.

Note: Pin also implements Deref to the target, which can be used to access the inner value. However, Deref only provides a reference that lives for as long as the borrow of the Pin, not the lifetime of the Pin itself. This method allows turning the Pin into a reference with the same lifetime as the original Pin.

Converts this Pin<&mut T> into a Pin<&T> with the same lifetime.

Gets a mutable reference to the data inside of this Pin.

This requires that the data inside this Pin is Unpin.

Note: Pin also implements DerefMut to the data, which can be used to access the inner value. However, DerefMut only provides a reference that lives for as long as the borrow of the Pin, not the lifetime of the Pin itself. This method allows turning the Pin into a reference with the same lifetime as the original Pin.

Gets a mutable reference to the data inside of this Pin.

Safety

This function is unsafe. You must guarantee that you will never move the data out of the mutable reference you receive when you call this function, so that the invariants on the Pin type can be upheld.

If the underlying data is Unpin, Pin::get_mut should be used instead.

Construct a new pin by mapping the interior value.

For example, if you wanted to get a Pin of a field of something, you could use this to get access to that field in one line of code. However, there are several gotchas with these “pinning projections”; see the pin module documentation for further details on that topic.

Safety

This function is unsafe. You must guarantee that the data you return will not move so long as the argument value does not move (for example, because it is one of the fields of that value), and also that you do not move out of the argument you receive to the interior function.

Get a pinned reference from a static reference.

This is safe, because T is borrowed for the 'static lifetime, which never ends.

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

Gets a pinned mutable reference from this nested pinned pointer.

This is a generic method to go from Pin<&mut Pin<Pointer<T>>> to Pin<&mut T>. It is safe because the existence of a Pin<Pointer<T>> ensures that the pointee, T, cannot move in the future, and this method does not enable the pointee to move. “Malicious” implementations of P::DerefMut are likewise ruled out by the contract of Pin::new_unchecked.

Get a pinned mutable reference from a static mutable reference.

This is safe, because T is borrowed for the 'static lifetime, which never ends.

Trait Implementations

Attempt to return the contents of the internal buffer, filling it with more data from the inner reader if it is empty. Read more

Tells this buffer that amt bytes have been consumed from the buffer, so they should no longer be returned in calls to poll_read. Read more

Attempts to return the contents of the internal buffer, filling it with more data from the inner reader if it is empty. Read more

Tells this buffer that amt bytes have been consumed from the buffer, so they should no longer be returned in calls to poll_read. Read more

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

The type of items yielded by the async iterator.

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

Attempt 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

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

Returns the bounds on the remaining length of the async iterator. Read more

Attempt to read from the AsyncRead into buf. Read more

Attempt to read from the AsyncRead into bufs using vectored IO operations. Read more

Attempts to read from the AsyncRead into buf. Read more

Attempt to seek to an offset, in bytes, in a stream. Read more

Attempts to seek to an offset, in bytes, in a stream. Read more

Waits for a seek operation to complete. Read more

Attempt to write bytes from buf into the object. Read more

Attempt to write bytes from bufs into the object using vectored IO operations. Read more

Attempt to flush the object, ensuring that any buffered data reach their destination. Read more

Attempt to close the object. Read more

Attempt to write bytes from buf into the object. Read more

Like poll_write, except that it writes from a slice of buffers. Read more

Determines if this writer has an efficient poll_write_vectored implementation. Read more

Attempts to flush the object, ensuring that any buffered data reach their destination. Read more

Initiates or attempts to shut down this writer, returning success when the I/O connection has completely shut down. Read more

Values yielded by the Body.

The error type this Body might generate.

Attempt to pull out the next data buffer of this stream.

Poll for an optional single HeaderMap of trailers. Read more

Returns true when the end of stream has been reached. Read more

Returns the bounds on the remaining length of the stream. Read more

Returns future that resolves to next data chunk, if any.

Returns future that resolves to trailers, if any.

Maps this body’s data value to a different value.

Maps this body’s error value to a different value.

Turn this body into a boxed trait object.

Turn this body into a boxed trait object that is !Sync.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Formats the value using the given formatter. Read more

Converts a Box<T> into a Pin<Box<T>>. If T does not implement Unpin, then *boxed will be pinned in memory and unable to be moved.

This conversion does not allocate on the heap and happens in place.

This is also available via Box::into_pin.

Constructing and pinning a Box with <Pin<Box<T>>>::from(Box::new(x)) can also be written more concisely using Box::pin(x). This From implementation is useful if you already have a Box<T>, or you are constructing a (pinned) Box in a different way than with Box::new.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Returns true if the underlying future should no longer be polled.

Returns true if the stream should no longer be polled.

The type of value produced on completion.

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

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

The type of value this generator yields. Read more

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

The type of value this generator returns. Read more

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

Resumes the execution of this generator. Read more

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

The type of value this generator yields. Read more

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

The type of value this generator returns. Read more

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

Resumes the execution of this generator. Read more

Feeds this value into the given Hasher. Read more

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

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

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

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

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

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

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

Formats the value using the given formatter.

The type of value produced by the sink when an error occurs.

Attempts to prepare the Sink to receive a value. Read more

Begin the process of sending a value to the sink. Each call to this function must be preceded by a successful call to poll_ready which returned Poll::Ready(Ok(())). Read more

Flush any remaining output from this sink. Read more

Flush any remaining output and close this sink, if necessary. Read more

Values yielded by the stream.

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

Returns the bounds on the remaining length of the stream. Read more

Convert an owned instance into a (conceptually owned) fat pointer. Read more

Drops the future represented by the given fat pointer. Read more

Convert an owned instance into a (conceptually owned) fat pointer. Read more

Drops the future represented by the given fat pointer. Read more

Convert an owned instance into a (conceptually owned) fat pointer. Read more

Drops the future represented by the given fat pointer. Read more

Convert an owned instance into a (conceptually owned) fat pointer. Read more

Drops the future represented by the given fat pointer. Read more

Convert an owned instance into a (conceptually owned) fat pointer. Read more

Drops the future represented by the given fat pointer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Creates a future which will wait for a non-empty buffer to be available from this I/O object or EOF to be reached. Read more

A convenience for calling [AsyncBufRead::consume] on Unpin IO types. Read more

Creates a future which will read all the bytes associated with this I/O object into buf until the delimiter byte or EOF is reached. This method is the async equivalent to BufRead::read_until. Read more

Creates a future which will read all the bytes associated with this I/O object into buf until a newline (the 0xA byte) or EOF is reached, This method is the async equivalent to BufRead::read_line. Read more

Returns a stream over the lines of this reader. This method is the async equivalent to BufRead::lines. Read more

Reads all bytes into buf until the delimiter byte or EOF is reached. Read more

Reads all bytes until a newline (the 0xA byte) is reached, and append them to the provided buffer. Read more

Returns a stream of the contents of this reader split on the byte byte. Read more

Returns the contents of the internal buffer, filling it with more data from the inner reader if it is empty. Read more

Tells this buffer that amt bytes have been consumed from the buffer, so they should no longer be returned in calls to read. Read more

Returns a stream over the lines of this reader. This method is the async equivalent to BufRead::lines. Read more

Creates an adaptor which will chain this stream with another. Read more

Tries to read some bytes directly into the given buf in asynchronous manner, returning a future type. Read more

Creates a future which will read from the AsyncRead into bufs using vectored IO operations. Read more

Creates a future which will read exactly enough bytes to fill buf, returning an error if end of file (EOF) is hit sooner. Read more

Creates a future which will read all the bytes from this AsyncRead. Read more

Creates a future which will read all the bytes from this AsyncRead. Read more

Helper method for splitting this read/write object into two halves. Read more

Creates an AsyncRead adapter which will read at most limit bytes from the underlying reader. Read more

Creates a new AsyncRead instance that chains this stream with next. Read more

Pulls some bytes from this source into the specified buffer, returning how many bytes were read. Read more

Pulls some bytes from this source into the specified buffer, advancing the buffer’s internal cursor. Read more

Reads the exact number of bytes required to fill buf. Read more

Reads an unsigned 8 bit integer from the underlying reader. Read more

Reads a signed 8 bit integer from the underlying reader. Read more

Reads an unsigned 16-bit integer in big-endian order from the underlying reader. Read more

Reads a signed 16-bit integer in big-endian order from the underlying reader. Read more

Reads an unsigned 32-bit integer in big-endian order from the underlying reader. Read more

Reads a signed 32-bit integer in big-endian order from the underlying reader. Read more

Reads an unsigned 64-bit integer in big-endian order from the underlying reader. Read more

Reads an signed 64-bit integer in big-endian order from the underlying reader. Read more

Reads an unsigned 128-bit integer in big-endian order from the underlying reader. Read more

Reads an signed 128-bit integer in big-endian order from the underlying reader. Read more

Reads an 32-bit floating point type in big-endian order from the underlying reader. Read more

Reads an 64-bit floating point type in big-endian order from the underlying reader. Read more

Reads an unsigned 16-bit integer in little-endian order from the underlying reader. Read more

Reads a signed 16-bit integer in little-endian order from the underlying reader. Read more

Reads an unsigned 32-bit integer in little-endian order from the underlying reader. Read more

Reads a signed 32-bit integer in little-endian order from the underlying reader. Read more

Reads an unsigned 64-bit integer in little-endian order from the underlying reader. Read more

Reads an signed 64-bit integer in little-endian order from the underlying reader. Read more

Reads an unsigned 128-bit integer in little-endian order from the underlying reader. Read more

Reads an signed 128-bit integer in little-endian order from the underlying reader. Read more

Reads an 32-bit floating point type in little-endian order from the underlying reader. Read more

Reads an 64-bit floating point type in little-endian order from the underlying reader. Read more

Reads all bytes until EOF in this source, placing them into buf. Read more

Reads all bytes until EOF in this source, appending them to buf. Read more

Creates an adaptor which reads at most limit bytes from it. Read more

Creates a future which will seek an IO object, and then yield the new position in the object and the object itself. Read more

Creates a future which will return the current seek position from the start of the stream. Read more

Creates a future which will seek an IO object, and then yield the new position in the object and the object itself. Read more

Creates a future which will rewind to the beginning of the stream. Read more

Creates a future which will return the current seek position from the start of the stream. Read more

Creates a future which will entirely flush this AsyncWrite. Read more

Creates a future which will entirely close this AsyncWrite.

Creates a future which will write bytes from buf into the object. Read more

Creates a future which will write bytes from bufs into the object using vectored IO operations. Read more

Write data into this object. Read more

Writes a buffer into this writer, returning how many bytes were written. Read more

Like write, except that it writes from a slice of buffers. Read more

Writes a buffer into this writer, advancing the buffer’s internal cursor. Read more

Attempts to write an entire buffer into this writer. Read more

Attempts to write an entire buffer into this writer. Read more

Writes an unsigned 8-bit integer to the underlying writer. Read more

Writes an unsigned 8-bit integer to the underlying writer. Read more

Writes an unsigned 16-bit integer in big-endian order to the underlying writer. Read more

Writes a signed 16-bit integer in big-endian order to the underlying writer. Read more

Writes an unsigned 32-bit integer in big-endian order to the underlying writer. Read more

Writes a signed 32-bit integer in big-endian order to the underlying writer. Read more

Writes an unsigned 64-bit integer in big-endian order to the underlying writer. Read more

Writes an signed 64-bit integer in big-endian order to the underlying writer. Read more

Writes an unsigned 128-bit integer in big-endian order to the underlying writer. Read more

Writes an signed 128-bit integer in big-endian order to the underlying writer. Read more

Writes an 32-bit floating point type in big-endian order to the underlying writer. Read more

Writes an 64-bit floating point type in big-endian order to the underlying writer. Read more

Writes an unsigned 16-bit integer in little-endian order to the underlying writer. Read more

Writes a signed 16-bit integer in little-endian order to the underlying writer. Read more

Writes an unsigned 32-bit integer in little-endian order to the underlying writer. Read more

Writes a signed 32-bit integer in little-endian order to the underlying writer. Read more

Writes an unsigned 64-bit integer in little-endian order to the underlying writer. Read more

Writes an signed 64-bit integer in little-endian order to the underlying writer. Read more

Writes an unsigned 128-bit integer in little-endian order to the underlying writer. Read more

Writes an signed 128-bit integer in little-endian order to the underlying writer. Read more

Writes an 32-bit floating point type in little-endian order to the underlying writer. Read more

Writes an 64-bit floating point type in little-endian order to the underlying writer. Read more

Flushes this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Shuts down the output stream, ensuring that the value can be dropped cleanly. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait. Read more

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait. Read more

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s. Read more

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s. Read more

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait. Read more

Use this to cast from one trait object type to another. Read more

Use this to upcast a trait to one of its supertraits. Read more

Use this to cast from one trait object type to another. This method is more customizable than the dyn_cast method. Here you can also specify the “source” trait from which the cast is defined. This can for example allow using casts from a supertrait of the current trait object. Read more

Use this to cast from one trait object type to another. With this method the type parameter is a config type that uniquely specifies which cast should be preformed. Read more

Compare self to key and return true if they are equal.

Returns the argument unchanged.

Map this future’s output to a different type, returning a new future of the resulting type. Read more

Map this future’s output to a different type, returning a new future of the resulting type. Read more

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

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

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

Convert this future into a single element stream. Read more

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

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

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

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

Catches unwinding panics while polling the future. Read more

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

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

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

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

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

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

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

Calls U::from(self).

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

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

The output that the future will produce on completion.

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

Which kind of future are we turning this into?

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

Creates a future from a value. Read more

Should always be Self

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

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

Maps this stream’s items to a different type, returning a new stream of the resulting type. Read more

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

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

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

Computes from this stream’s items new items of a different type using an asynchronous closure. Read more

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

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

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

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

Repeats a stream endlessly. Read more

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

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

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

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

Flattens a stream of streams into just one continuous stream. Polls inner streams concurrently. Read more

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

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

Combinator similar to [StreamExt::fold] that holds internal state and produces a new stream. Read more

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

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

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

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

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

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

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

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

Borrows a stream, rather than consuming it. Read more

Catches unwinding panics while polling the stream. Read more

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

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

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

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

An adapter for zipping two streams together. Read more

Adapter for chaining two streams. Read more

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

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

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

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

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

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

A convenience method for calling [Stream::poll_next] on Unpin stream types. Read more

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

The resulting type after obtaining ownership.

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

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

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type of successful values yielded by this future

The type of failures yielded by this future

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

Maps this future’s success value to a different value. Read more

Maps this future’s success value to a different value, and permits for error handling resulting in the same type. Read more

Maps this future’s error value to a different value. Read more

Maps this future’s Error to a new error type using the Into trait. Read more

Maps this future’s Ok to a new type using the Into trait. Read more

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

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

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

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

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

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

Unwraps this future’s output, producing a future with this future’s Ok type as its Output type. Read more

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

A convenience method for calling [TryFuture::try_poll] on Unpin future types. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type of successful values yielded by this future

The type of failures yielded by this future

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

A convenience method for calling [TryStream::try_poll_next] on Unpin stream types. Read more

Adapter that converts this stream into an AsyncRead. Read more

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

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