mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
add #[must_use] to more futures and streams (#1309)
This commit is contained in:
@@ -168,7 +168,7 @@ impl AsRawFd for UnixListener {
|
||||
}
|
||||
|
||||
/// Future type returned by [`UnixListener::accept`].
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
#[must_use = "futures do nothing unless you `.await` or poll them"]
|
||||
#[derive(Debug)]
|
||||
pub struct Accept<'a> {
|
||||
listener: &'a mut UnixListener,
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::task::{Context, Poll};
|
||||
/// A future that receives a datagram from the connected address.
|
||||
///
|
||||
/// This `struct` is created by [`recv`](crate::UnixDatagram::recv).
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
#[must_use = "futures do nothing unless you `.await` or poll them"]
|
||||
#[derive(Debug)]
|
||||
pub struct Recv<'a, 'b> {
|
||||
socket: &'a mut UnixDatagram,
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::task::{Context, Poll};
|
||||
/// A future that receives a datagram.
|
||||
///
|
||||
/// This `struct` is created by [`recv_from`](crate::UnixDatagram::recv_from).
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
#[must_use = "futures do nothing unless you `.await` or poll them"]
|
||||
#[derive(Debug)]
|
||||
pub struct RecvFrom<'a, 'b> {
|
||||
socket: &'a UnixDatagram,
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::task::{Context, Poll};
|
||||
/// A future that sends a datagram to the connected address.
|
||||
///
|
||||
/// This `struct` is created by [`send`](crate::UnixDatagram::send).
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
#[must_use = "futures do nothing unless you `.await` or poll them"]
|
||||
#[derive(Debug)]
|
||||
pub struct Send<'a, 'b> {
|
||||
socket: &'a UnixDatagram,
|
||||
|
||||
@@ -8,7 +8,7 @@ use std::task::{Context, Poll};
|
||||
/// A future that sends a datagram to a given address.
|
||||
///
|
||||
/// This `struct` is created by [`send_to`](crate::UnixDatagram::send_to).
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
#[must_use = "futures do nothing unless you `.await` or poll them"]
|
||||
#[derive(Debug)]
|
||||
pub struct SendTo<'a, 'b, P> {
|
||||
socket: &'a UnixDatagram,
|
||||
|
||||
@@ -29,7 +29,7 @@ pub struct UnixStream {
|
||||
/// Future returned by `UnixStream::connect` which will resolve to a
|
||||
/// `UnixStream` when the stream is connected.
|
||||
#[derive(Debug)]
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
#[must_use = "futures do nothing unless you `.await` or poll them"]
|
||||
pub struct ConnectFuture {
|
||||
stream: Option<io::Result<UnixStream>>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user