TryStreamExt::try_ready_chunks
(#2757)TryStreamExt::{try_all,try_any}
(#2783)UnboundedSender::{len,is_empty}
(#2750)Sync
impl of FuturesUnordered
(#2788)FlattenUnordered
(#2726, #2728)TryFlattenUnordered
(#2577, #2590, #2606, #2607)AbortHandle::is_aborted
(#2710)AbortRegistration::handle
(#2712)BiLock
strict-provenance compatible (#2716)Either::as_pin_mut
and Either::as_pin_ref
(#2691)Shared::ptr_eq
and Shared::ptr_hash
(#2691)FusedStream
for Buffered
(#2676)FusedStream
for all streams in ReadyChunks
(#2693)FuturesOrdered::push_front
(#2664)Fut::Output: Clone
bounds from some Shared
methods (#2662)T: Debug
bounds from Debug
implementations of mpsc
and oneshot
types (#2666, #2667)join!
and try_join!
macros (#2649)Clone
for sink::Drain
(#2650)select_with_strategy
streams (#2635)Sync
impl of BiLockGuard
(#2570)FuturesUnordered
(#2574)Shared
(#2576)Mutex::lock_owned
and Mutex::try_lock_owned
(#2571)io::copy_buf_abortable
(#2507)Unpin
bound from TryStreamExt::into_async_read
(#2599)run_until_stalled
handle self-waking futures (#2593)FuturesOrdered
in try_join_all
(#2556)LocalPool
waker (#2608)stream::Chunk
adapters size hints (#2611)push_front
and push_back
to FuturesOrdered
(#2591)FuturesOrdered::push
in favor of FuturesOrdered::push_back
(#2591)FlattenUnordered
that introduced in 0.3.20 (#2566)NOTE: This release has been yanked due to a bug fixed in 0.3.21.
-Zmiri-tag-raw-pointers
is enabled. This raises MSRV of futures-task
to 1.45. (#2548, #2550)FuturesUnordered
to respect yielding from future (#2551)StreamExt::{flatten_unordered, flat_map_unordered}
(#2083)read-initializer
feature (#2534)FuturesUnordered
(#2535)FuturesUnordered
and tokio's cooperative scheduling (#2527)StreamExt::count
(#2495)NOTE: This release has been yanked. See #2529 for details.
Sink
implementation on stream::Scan
(#2499)task::noop_waker_ref
available without std
feature (#2505)LineWriter
(#2477)proc-macro-hack
. This raises MSRV of utility crates to 1.45. (#2520)FuturesOrdered
in join_all
(#2412){future, stream}::poll_immediate
(#2452)stream_select!
macro (#2262)Default
for OptionFuture
(#2471)Peekable::{peek_mut, poll_peek_mut}
(#2488)BufReader::seek_relative
(#2489)TryStreamExt::try_chunks
(#2438)StreamExt::{all, any}
(#2460)stream::select_with_strategy
(#2450)io_slice_advance
interface (#2454)#[proc_macro]
at Rust 1.45+ to fix an issue where proc macros don't work with rust-analyzer (#2407)#[test]
function attribute (#2409)stream::abortable
(#2410)FuturesUnordered::clear
(#2415)IntoIterator
for FuturesUnordered
(#2423)Send
and Sync
for FuturesUnordered
iterators (#2416)FuturesUnordered::iter_pin_ref
public (#2423)SelectAll::clear
(#2430)SelectAll::{iter, iter_mut}
(#2428)IntoIterator
for SelectAll
(#2428)Clone
for WeakShared
(#2396)future::SelectAll::into_inner
(#2363)UnboundedReceiver::try_next
after None
(#2369)futures_util
(#2377)AsyncSeekExt::stream_position
(#2380)stream::Peekable::{next_if, next_if_eq}
(#2379)FuturesUnordered
(#2333)mpsc::Receiver
(#2304)Shared::{strong_count, weak_count}
(#2346)no_std
support for task::noop_waker_ref
(#2332)Stream::size_hint
for Either
(#2325)Unpin
impl of future::{MaybeDone, TryMaybeDone}
where trait bounds were accidentally added in 0.3.9. (#2317)AsyncReadExt::{read_to_end, read_to_string}
(#2314)NOTE: This release has been yanked. See #2310 for details.
sink::unfold
by specifying more of its types (breaking change -- see #2311)NOTE: This release has been yanked. See #2310 for details.
async-await
crate feature is disabled (#2273)stream::repeat_with
(#2279)StreamExt::unzip
(#2263)sink::unfold
(#2268)SinkExt::feed
(#2155)FusedFuture
for oneshot::Receiver
(#2300)Clone
for sink::With
(#2290)MapOkOrElse
, MapInto
, OkInto
, TryFlatten
, WriteAllVectored
(#2275)NOTE: This release has been yanked. See #2310 for details.
#[proc_macro]
at Rust 1.45+ (#2243)WeakShared
(#2169)TryStreamExt::try_buffered
(#2245)StreamExt::cycle
(#2252)Clone
for stream::{Empty, Pending, Repeat, Iter}
(#2248, #2252)TryStreamExt
combinators (#2250)NOTE: This release has been yanked. See #2310 for details.
MappedMutexGuard
(#2240)TakeUntil
(#2235)panic_waker
(#2236)NOTE: This release has been yanked. See #2310 for details.
task::waker
(#2206)AsyncBufReadExt::fill_buf
(#2225)TryStreamExt::try_take_while
(#2212)is_connected_to
method to mpsc::{Sender, UnboundedSender}
(#2179)is_connected_to
method to oneshot::Sender
(#2158)FusedStream
for FuturesOrdered
(#2205)track_closed
method to AsyncWriteTestExt
and SinkTestExt
(#2159)InterleavePending
(#2208)AssertUnmoved
(#2208)NOTE: This release has been yanked. See #2310 for details.
StreamExt::flat_map
.StreamExt::ready_chunks
.*_unpin
methods to SinkExt
.cancellation()
future to oneshot::Sender
.reunite
method to ReadHalf
and WriteHalf
.Extend
implementations for Futures(Un)Ordered
and SelectAll
.join!
and select!
macros.no_std
support for the pending!
and poll!
macros.Send
and Sync
support for AssertUnmoved
.Shared
wasn't relinquishing control to the executor.Send
bound on the output of RemoteHandle
.FuturesUnordered
.--feature
s.StreamExt::forward
.unsafe
.NOTE: This release has been yanked. See #2310 for details.
Drop
for UnboundedReceiver
(#2064)NOTE: This release has been yanked. See #2310 for details.
NOTE: This release has been yanked. See #2310 for details.
SplitSink
(#1969)select_biased!
macro (#1976)hash_receiver
method to mpsc channel (#1962)stream::try_unfold
(#1977)AtomicWaker::new()
is now const fn
(#2007)stream::Peekable::peek
(#2021)StreamExt::scan
(#2044)AsyncRead
/Write
for BufReader
/Writer
(#2033)Spawn
and LocalSpawn
for Arc<impl Spawn
and Rc<impl Spawn>
(#2039)Sync
issues with FuturesUnordered
(#2054)into_inner
method for future::Ready
(#2055)MappedMutexGuard
API (#2056)FuturesUnordered
(#2049)TryFutureExt::map_ok_or_else
(#2058)NOTE: This release has been yanked. See #2310 for details.
SpawnExt
and LocalSpawnExt
trait (breaking change -- see #1959)NOTE: This release has been yanked. See #2310 for details.
Spawn
trait and FuturesUnordered::push
to take &self
(#1950)Spawn
and FutureObj
out of futures-core
and into futures-task
(#1925)executor
feature (#1949)copy_into
/copy_buf_into
(#1948)SinkExt::send_all
to accept a TryStream
(#1946)ThreadPool::run
(#1944)io::Cursor
(#1943)BufReader::poll_seek_relative
(#1938)skip
to take a usize
rather than u64
(#1931)Stream
impl for VecDeque
(#1930)Peekable::peek
to poll_peek
(#1928)FuturesUnordered
(#1922)ThreadPool
optional (#1910)oneshot::Sender::poll_cancel
to poll_canceled
(#1908)Clone
implementationsasync-await
feature (#1816)async-await
feature no longer require std
feature (#1815)proc-macro2
, syn
, and quote
to 1.0 (#1798)BiLock
(#1827)io::{Empty, Repeat, Sink}
(#1829)AsyncRead::initializer
API unstable (#1845)Never
type from futures-core
to futures-util
(#1836)ArcWake::wake_by_ref
(#1797)AsyncReadExt::chain
(#1810)Stream::size_hint
(#1853)FusedFuture
(#1868) and FusedStream
implementations (#1831)From
impl for Mutex
(#1839)Mutex::{get_mut, into_inner}
(#1839)TryConcat
and TryFilter
(#1814)Unpin
bound and implemented AsyncBufRead
for io::Take
(#1821)Unpin
bounds on get_pin_mut
(#1820)SendAll
to flush the Sink
when the source Stream
is pending (#1877)num_cpus::get()
returns zero (#1835)rand
by using our own PRNG (#1837)futures-core
dependency from futures-sink
(#1832)join!
and try_join!
as procedural macros to allow passing expressions (#1783)TryFuture
and TryStream
for forward compatibility. See #1776 for more details. (#1777)AsyncReadExt::read_to_end
to return the total number of bytes read (#1721)ArcWake::into_waker
to a free function waker
(#1676)channel::oneshot
in no_std environment (#1749)Future
bounds to FusedFuture
(#1779)Stream
bounds to FusedStream
(#1779)StreamExt::boxed
to return BoxStream
(#1780)StreamExt::boxed_local
(#1780)AsyncReadExt::read_to_string
(#1721)AsyncWrite
for IntoAsyncRead
(#1734)Compat01As03
and Compat01As03Sink
(#1705)ThreadPool::{spawn_ok, spawn_obj_ok}
(#1750)TryStreamExt::try_flatten
(#1731)FutureExt::now_or_never
(#1747)try_ready!
macro in favor of ready!(..)?
. (#1602)io::Window::{set_start, set_end}
in favor of io::Window::set
. (#1667)pin_utils::pin_mut!
macro. (#1686)?Sized
types in some methods and structs. (#1647)Send + Sync
bounds to ArcWake
trait to fix unsoundness. (#1654)AsyncReadExt::copy_into
to consume self
. (#1674)future::empty
to pending
. (#1689)#[must_use]
to some combinators. (#1600)AsyncWriteExt::{write, write_vectored}
. (#1612)AsyncReadExt::read_vectored
. (#1612)TryFutureExt::try_poll_unpin
. (#1613)TryFutureExt::try_flatten_stream
. (#1618)io::BufWriter
. (#1608)Sender::same_receiver
and UnboundedSender::same_receiver
. (#1617)future::try_select
. (#1622)TryFutureExt::{inspect_ok, inspect_err}
. (#1630)Compat::get_ref
. (#1648)io::Window::set
. (#1667)AsyncWriteExt::into_sink
. (#1675)AsyncBufReadExt::copy_buf_into
. (#1674)stream::pending
. (#1689)std::error::Error
for SpawnError
. (#1604)Stream
for FlattenSink
. (#1651)Sink
for TryFlattenStream
. (#1651)AsyncRead
, AsyncWrite
, AsyncSeek
, AsyncBufRead
, FusedFuture
and FusedStream
for Either. (#1695)Never
type, an alias for core::convert::Infallible
.futures-channel
dependency from futures-sink
and make futures-sink
an optional dependency of futures-channel
.Sink::SinkError
to Sink::Error
.futures-util
optional.async_await
.AsyncRead::poll_vectored_read
and AsyncWrite::poll_vectored_write
to use stabilized std::io::{IoSlice, IoSliceMut}
instead of iovec::IoVec
, and renamed to AsyncRead::poll_read_vectored
and AsyncWrite::poll_write_vectored
.LocalBoxFuture
and FutureExt::boxed_local
.TryStreamExt::{try_filter, inspect_ok, inspect_err}
.try_future::select_ok
.AsyncBufReadExt::{read_line, lines}
.io::BufReader
.futures_api
.StreamObj
, cautioned against usage of FutureObj
.StreamExt::select
to a function.AsyncBufRead
and AsyncSeek
traits.future::Fuse::terminated
constructor.never_error
combinator.StreamExt::enumerate
.TryStreamExt::{and_then, or_else}
.Either
type rather than the one from the either
crate.futures_api
.Forward
combinator to drop sink after completion, and allow !Unpin
Sink
s.Sink
s.Sink::Item
to a generic parameter Sink<Item>
, allowing Sink
s to accept multiple different types, including types containing references.AsyncRead
and AsyncWrite
to take Pin<&mut Self>
rather than &mut self
.no_std
+ alloc
use.join
and try_join
combinators to functions.cfg-target-has-atomic
feature.LocalWaker
.#[must_use]
to Stream
and Sink
traits.!Unpin
futures in JoinAll
.try_join_all
combinator.TokioDefaultSpawner
and tokio-compat
.Pin::set
.AssertUnmoved
and PendingOnce
.AssertUnmoved
.select!
macro.Default
for Mutex
and SelectAll
.pin
and arbitrary_self_types
features.select_all
for streams.TryStream::into_async_read
for converting from a stream of bytes into an AsyncRead
.try_poll_next_unpin
.select!
as a procedural macro for better error messagesjoin_all
from the facadeselect!
macroselect_next_some
method for getting only the Some
elements of a stream from select!
futures::lock::Mutex
for async-aware synchronization.Pin<Box<_>>
to StreamObj
Shared
new
method and more derive
s to the Compat
typejoin_all
try_concat
#![no_std]
Task
, accomplished by wrapping 0.1 futures in an 0.1 Spawn
when using them as 0.3 futures.AtomicWaker
implementation.Spawn
from task::Context
and replaces Context
with LocalWaker
.Spawn
and LocalSpawn
traits and FutureObj
and LocalFutureObj
types to futures-core
.crate
visibility with pub(crate)
now that crate
visibility is no longer included in the 2018 editionNote: This release does not work, use 0.3.0-alpha.5
instead
future::ok
and future:err
to create result wrapping futures (similar to future::ready
)futures-test
crate with testing utilitiesStreamExt::boxed
combinatorFuturesUnordered
StreamObj
(similar to FutureObj
)futures@0.1
for compatibility layercore::pin
spawn!
and spawn_with_handle!
macrosSpawnExt
methods spawn
and spawn_with_handle
pin_utils
crateFutureExt
combinators boxed
and unit_error
select!
and join!
macrostry_join!
macroStreamExt
combinator methods try_join
and for_each_concurrent
TryStreamExt
combinator methods into_stream
, try_filter_map
, try_skip_while
, try_for_each_concurrent
and try_buffer_unordered
StreamExt::buffered
and StreamExt::buffer_unordered
StreamExt::buffered
, StreamExt::buffer_unordered
task::local_waker_ref_from_nonlocal
and task::local_waker_ref
functionsStreamExt::select
AsyncReadExt
, AsyncWriteExt
TryFutureExt
empty
, lazy
, maybe_done
, poll_fn
and ready
FutureOption
join!
, select!
and pending!
TryStreamExt
TryStreamExt
combinators map_ok
, map_err
, err_into
, try_next
and try_for_each
Drain
, a sink that will discard all items given to it. Can be created using the drain
functionwrite_all
combinatorAsyncWrite
impl for Cursor<T: AsMut<[u8]>>
FuturesUnordered
optimization: Since the context stores a &LocalWaker
reference, it was possible to avoid cloning the Arc
of the wakerjoin!
and select!
macros are now exposed by the futures
crateREADME.md
sink::MapErr::get_pinned_mut
is now called get_pin_mut
use_extern_macros
feature for macro reexports#[deny(warnings)]
was removed from all crates and is now only enforced in the CIFut
future, F
function, St
stream, Si
sink, S
sink & stream, R
reader, W
writer, T
value, E
errorFuturesUnordered
was refactored to align with this definition.close
method on sink::Wait
stream::iter
as stream::iter_result
FromIterator
implementation for FuturesOrdered
and FuturesUnordered
.prelude
module has been added to glob import from and pick up a whole bunch of useful typessync::mpsc::Sender::poll_ready
has been added as an APIsync::mpsc::Sender::try_send
has been added as an APIBiLock
methodsClone
for FutureResult
Stream
trait through SinkMapErr
stream::futures_ordered
next to futures_unordered
Stream::buffered
on top of stream::futures_ordered
(much more efficient at scale).with_notify
function for abstractions which previously required UnparkEvent
.get_ref
/get_mut
/into_inner
functions for stream take/skip methodsClone
implementation for SharedItem
and SharedError
mpsc::spawn
function to spawn a Stream
into an Executor
reunite
function for BiLock
and the split stream/sink types to rejoin two halves and reclaim the original item.stream::poll_fn
to behave similarly to future::poll_fn
Sink::with_flat_map
like Iterator::flat_map
AtomicTask
in the public API for managing synchronization around task notifications.Canceled
type of the sync
and unsync
modules.boxed
methods. These methods have caused more confusion than they‘ve solved historically, so it’s recommended to use a local extension trait or a local helper instead of the trait-based methods.Stream::merge
method as it's less ergonomic than select
.oneshot::Sender::is_canceled
to test if a oneshot is canceled off a task.UnboundedSender::send
in favor of a method named unbounded_send
to avoid a conflict with Sink::send
.stream::iter
function in favor of an stream::iter_ok
adaptor to avoid the need to deal with Result
manually.inspect
function to the Future
and Stream
traits along the lines of Iterator::inspect
This is a relatively large release of the futures
crate, although much of it is from reworking internals rather than new APIs. The banner feature of this release is that the futures::{task, executor}
modules are now available in no_std
contexts! A large refactoring of the task system was performed in PR #436 to accommodate custom memory allocation schemes and otherwise remove all dependencies on std
for the task module. More details about this change can be found on the PR itself.
Other API additions in this release are:
FuturesUnordered::push
method was added and the FuturesUnordered
type itself was completely rewritten to efficiently track a large number of futures.Task::will_notify_current
method was added with a slightly different implementation than Task::is_current
but with stronger guarantees and documentation wording about its purpose.get_ref
, get_mut
, and into_inner
methods for accessing internal futures and state.Stream::concat2
method was added which should be considered the “fixed” version of concat
, this one doesn't panic on empty streams.Executor
trait has been added to represent abstracting over the concept of spawning a new task. Crates which only need the ability to spawn a future can now be generic over Executor
rather than requiring a tokio_core::reactor::Handle
.As with all 0.1.x releases this PR is intended to be 100% backwards compatible. All code that previously compiled should continue to do so with these changes. As with other changes, though, there are also some updates to be aware of:
task::park
function has been renamed to task::current
.Task::unpark
function has been renamed to Task::notify
, and in general terminology around “unpark” has shifted to terminology around “notify”Unpark
trait has been deprecated in favor of the Notify
trait mentioned above.UnparkEvent
structure has been deprecated. It currently should perform the same as it used to, but it's planned that in a future 0.1.x release the performance will regress for crates that have not transitioned away. The primary primitive to replace this is the addition of a push
function on the FuturesUnordered
type. If this does not help implement your use case though, please let us know!Task::is_current
method is now deprecated, and you likely want to use Task::will_notify_current
instead, but let us know if this doesn't suffice!stream::FromErr
and sink::SinkFromErr
PartialEq
and Eq
to mpsc::SendError
Shared
with spawn
instead of UnparkEvent
Stream::from_err
and Sink::from_err
SendError
to be Clone
when possibleThe major highlight of this release is the addition of a new “default” method on the Sink
trait, Sink::close
. This method is used to indicate to a sink that no new values will ever need to get pushed into it. This can be used to implement graceful shutdown of protocols and otherwise simply indicates to a sink that it can start freeing up resources.
Currently this method is not a default method to preserve backwards compatibility, but it‘s intended to become a default method in the 0.2 series of the futures
crate. It’s highly recommended to audit implementations of Sink
to implement the close
method as is fit.
Other changes in this release are:
Future::select2
was added for a heterogeneous select.Shared::peek
method was added to check to see if it's done.Sink::map_err
was implementedlog
dependency was removedDebug
trait are now generally available.stream::IterStream
type was renamed to stream::Iter
(with a reexport for the old name).Sink::wait
method which returns an adapter to use an arbitrary Sink
synchronously.Stream::concat
method was added to concatenate a sequence of lists.oneshot::Sender::complete
method was renamed to send
and now returns a Result
indicating successful transmission of a message or not. Note that the complete
method still exists, it's just deprecated.unsync
module which mirrors sync
to the extent that it can but is intended to not perform cross-thread synchronization (only usable within one thread).Shared
to work when handles may not get poll'd again.Send/Sync
of a few typesfuture::tail_fn
for more easily writing loopsfrom_err
Shared
implementationStream::take_while
stream::futures_unordered
Stream::for_each
Stream::chain
stream::repeat
&mut self
to &self
in UnboundedSender::send
Future::shared
method for creating a future that can be shared amongst threads by cloning the future itself. All derivative futures will resolve to the same value once the original future has been resolved.FutureFrom
trait for future-based conversionReceiver::close
future::poll_fn
for quickly adapting a Poll
-based function to a future.Either
enum with two branches to easily create one future type based on two different futures created on two branches of control flow.'static
bound on Unpark
send_all
and forward
to send as many items as possible before calling poll_complete
.ok
, err
, and result
future to assist returning different varieties in different branches of a function.CpuFuture::forget
to allow the computation to continue running after a drop.stream::futures_unordered
combinator to turn a list of futures into a stream representing their order of completion.Clone
bound on the type parameter on UnboundedSender
#![no_std]
supportThis is quite a large release relative to the previous point releases! As with all 0.1 releases, this release should be fully compatible with the 0.1.3 release. If any incompatibilities are discovered please file an issue!
The largest changes in 0.1.4 are the addition of a Sink
trait coupled with a reorganization of this crate. Note that all old locations for types/traits still exist, they're just deprecated and tagged with #[doc(hidden)]
.
The new Sink
trait is used to represent types which can periodically over time accept items, but may take some time to fully process the item before another can be accepted. Essentially, a sink is the opposite of a stream. This trait will then be used in the tokio-core crate to implement simple framing by modeling I/O streams as both a stream and a sink of frames.
The organization of this crate is to now have three primary submodules, future
, stream
, and sink
. The traits as well as all combinator types are defined in these submodules. The traits and types like Async
and Poll
are then reexported at the top of the crate for convenient usage. It should be a relatively rare occasion that the modules themselves are reached into.
Finally, the 0.1.4 release comes with a new module, sync
, in the futures crate. This is intended to be the home of a suite of futures-aware synchronization primitives. Currently this is inhabited with a oneshot
module (the old oneshot
function), a mpsc
module for a new multi-producer single-consumer channel, and a BiLock
type which represents sharing ownership of one value between two consumers. This module may expand over time with more types like a mutex, rwlock, spsc channel, etc.
Notable deprecations in the 0.1.4 release that will be deleted in an eventual 0.2 release:
TaskRc
type is now deprecated in favor of BiLock
or otherwise Arc
sharing.future
module, not the top-level of the crate.Oneshot
and Complete
types are now replaced with the sync::oneshot
module.collect
are deprecated in favor of more appropriately named versions like join_all
finished
constructor is now ok
.failed
constructor is now err
.done
constructor is now result
.As always, please report bugs to https://github.com/rust-lang-nursery/futures-rs and we always love feedback! If you‘ve got situations we don’t cover, combinators you'd like to see, or slow code, please let us know!
Full changelog:
buffer_unordered
combinatorSink
sync
module for synchronization primitivesBiLock
sync primitive for two-way sharingTaskRc
collect
to join_all
Events
for improved clone performanceStream::select
for selecting items from two streams like merge
but requiring the same types.stream::unfold
constructorsync::mpsc
module with a futures-aware multi-producer single-consumer queue. Both bounded (with backpressure) and unbounded (no backpressure) variants are provided.failed
, finished
, and done
combinators to err
, ok
, and result
.Stream::forward
to send all items to a sink, like Sink::send_all
Stream::split
for streams which are both sinks and streams to have separate ownership of the stream/sink halvesjoin_all
with concurrencyoneshot
for efficiency and removing allocations on send/recvStream::take
and Stream::skip
select_ok
combinator to pick the first of a list that succeedsSelectAllNext
typedefStream::chunks
for receiving chunks of datastream::channel
for efficiency, correctness, and removing allocationsSend + 'static
bounds on the stream::Empty
typeFutureSender
SendError
typeFuture::into_stream
to convert to a single-element streamFuture::flatten_to_stream
to convert a future of a stream to a streamStream::catch_unwind
Initial release!