Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions async/src/traits/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ pub trait AsyncConsumer: Consumer {
/// # Cancel safety
///
/// If future is cancelled then no item removed from the ring buffer.
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct PopFuture<'a, A: AsyncConsumer + ?Sized> {
owner: &'a mut A,
done: bool,
Expand Down Expand Up @@ -166,6 +167,7 @@ impl<A: AsyncConsumer> Future for PopFuture<'_, A> {
/// # Cancel safety
///
/// If future is cancelled then slice can be partially filled.
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct PopSliceFuture<'a, 'b, A: AsyncConsumer + ?Sized>
where
A::Item: Copy,
Expand Down Expand Up @@ -226,6 +228,7 @@ where
///
/// If future is cancelled then `vec` contains items taken from RB before cancellation.
#[cfg(feature = "alloc")]
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct PopVecFuture<'a, 'b, A: AsyncConsumer + ?Sized> {
owner: &'a mut A,
vec: Option<&'b mut alloc::vec::Vec<A::Item>>,
Expand Down Expand Up @@ -275,6 +278,7 @@ impl<A: AsyncConsumer> Future for PopVecFuture<'_, '_, A> {
/// # Cancel safety
///
/// The future can be safely cancelled.
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct WaitOccupiedFuture<'a, A: AsyncConsumer + ?Sized> {
owner: &'a A,
count: usize,
Expand Down
4 changes: 4 additions & 0 deletions async/src/traits/producer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ pub trait AsyncProducer: Producer {
/// # Cancel safety
///
/// If future is cancelled no item pushed to the RB.
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct PushFuture<'a, A: AsyncProducer + ?Sized> {
owner: &'a mut A,
item: Option<A::Item>,
Expand Down Expand Up @@ -173,6 +174,7 @@ impl<A: AsyncProducer> Future for PushFuture<'_, A> {
/// # Cancel safety
///
/// On cancel the slice can be copied partially.
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct PushSliceFuture<'a, 'b, A: AsyncProducer + ?Sized>
where
A::Item: Copy,
Expand Down Expand Up @@ -230,6 +232,7 @@ where
/// # Cancel safety
///
/// If future is cancelled then remaining items are left in iterator.
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct PushIterFuture<'a, A: AsyncProducer + ?Sized, I: Iterator<Item = A::Item>> {
owner: &'a mut A,
iter: Option<Peekable<I>>,
Expand Down Expand Up @@ -278,6 +281,7 @@ impl<A: AsyncProducer, I: Iterator<Item = A::Item>> PushIterFuture<'_, A, I> {
/// # Cancel safety
///
/// You can safely cancel this future.
#[must_use = "futures do nothing unless you `.await` or poll them"]
pub struct WaitVacantFuture<'a, A: AsyncProducer + ?Sized> {
owner: &'a A,
count: usize,
Expand Down
Loading