mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
Set Stream types as must_use
This commit is contained in:
parent
b4fa47bd09
commit
bd9a07f3ad
@ -37,6 +37,7 @@ pub struct Sender<T> {
|
||||
/// `Stream` trait to represent received messages.
|
||||
///
|
||||
/// [`channel`]: fn.channel.html
|
||||
#[must_use = "streams do nothing unless polled"]
|
||||
pub struct Receiver<T> {
|
||||
rx: PollEvented<channel::Receiver<T>>,
|
||||
}
|
||||
|
@ -310,6 +310,7 @@ pub trait Codec {
|
||||
/// the `Codec` trait to encode and decode frames.
|
||||
///
|
||||
/// You can acquire a `Framed` instance by using the `Io::framed` adapter.
|
||||
#[must_use = "streams do nothing unless polled"]
|
||||
pub struct Framed<T, C> {
|
||||
upstream: T,
|
||||
codec: C,
|
||||
|
@ -25,6 +25,7 @@ pub struct TcpListener {
|
||||
|
||||
/// Stream returned by the `TcpListener::incoming` function representing the
|
||||
/// stream of sockets received from a listener.
|
||||
#[must_use = "streams do nothing unless polled"]
|
||||
pub struct Incoming {
|
||||
inner: TcpListener,
|
||||
}
|
||||
|
@ -21,6 +21,7 @@ use reactor::timeout_token::TimeoutToken;
|
||||
/// Note that timeouts are not intended for high resolution timers, but rather
|
||||
/// they will likely fire some granularity after the exact instant that they're
|
||||
/// otherwise indicated to fire at.
|
||||
#[must_use = "streams do nothing unless polled"]
|
||||
pub struct Interval {
|
||||
token: TimeoutToken,
|
||||
next: Instant,
|
||||
|
Loading…
x
Reference in New Issue
Block a user