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