diff --git a/src/channel.rs b/src/channel.rs index 6251afb49..85060e52b 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -37,6 +37,7 @@ pub struct Sender { /// `Stream` trait to represent received messages. /// /// [`channel`]: fn.channel.html +#[must_use = "streams do nothing unless polled"] pub struct Receiver { rx: PollEvented>, } diff --git a/src/io/frame.rs b/src/io/frame.rs index 821dc3cfb..151648ac2 100644 --- a/src/io/frame.rs +++ b/src/io/frame.rs @@ -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 { upstream: T, codec: C, diff --git a/src/net/tcp.rs b/src/net/tcp.rs index e1a680389..7cd7a1458 100644 --- a/src/net/tcp.rs +++ b/src/net/tcp.rs @@ -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, } diff --git a/src/reactor/interval.rs b/src/reactor/interval.rs index 647ea45bf..429be6c82 100644 --- a/src/reactor/interval.rs +++ b/src/reactor/interval.rs @@ -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,