summaryrefslogtreecommitdiffstats
path: root/tokio/src/signal
diff options
context:
space:
mode:
authorOleg Nosov <olegnosov1@gmail.com>2020-01-24 20:31:13 +0300
committerCarl Lerche <me@carllerche.com>2020-01-24 09:31:13 -0800
commitf9ddb93604a830d106475bd4c4cae436fafcc0da (patch)
tree6f200680e68b290794ef0512dcb031ef6d81c5ea /tokio/src/signal
parenta70f7203a46d471345128832987017612d8e4585 (diff)
docs: use third form in API docs (#2027)
Diffstat (limited to 'tokio/src/signal')
-rw-r--r--tokio/src/signal/registry.rs20
-rw-r--r--tokio/src/signal/unix.rs8
-rw-r--r--tokio/src/signal/windows.rs4
3 files changed, 16 insertions, 16 deletions
diff --git a/tokio/src/signal/registry.rs b/tokio/src/signal/registry.rs
index d5b44cce..50edd2b6 100644
--- a/tokio/src/signal/registry.rs
+++ b/tokio/src/signal/registry.rs
@@ -22,10 +22,10 @@ pub(crate) struct EventInfo {
/// An interface for retrieving the `EventInfo` for a particular eventId.
pub(crate) trait Storage {
- /// Get the `EventInfo` for `id` if it exists.
+ /// Gets the `EventInfo` for `id` if it exists.
fn event_info(&self, id: EventId) -> Option<&EventInfo>;
- /// Invoke `f` once for each defined `EventInfo` in this storage.
+ /// Invokes `f` once for each defined `EventInfo` in this storage.
fn for_each<'a, F>(&'a self, f: F)
where
F: FnMut(&'a EventInfo);
@@ -66,7 +66,7 @@ impl<S> Registry<S> {
}
impl<S: Storage> Registry<S> {
- /// Register a new listener for `event_id`.
+ /// Registers a new listener for `event_id`.
fn register_listener(&self, event_id: EventId, listener: Sender<()>) {
self.storage
.event_info(event_id)
@@ -77,7 +77,7 @@ impl<S: Storage> Registry<S> {
.push(listener);
}
- /// Mark `event_id` as having been delivered, without broadcasting it to
+ /// Marks `event_id` as having been delivered, without broadcasting it to
/// any listeners.
fn record_event(&self, event_id: EventId) {
if let Some(event_info) = self.storage.event_info(event_id) {
@@ -85,9 +85,9 @@ impl<S: Storage> Registry<S> {
}
}
- /// Broadcast all previously recorded events to their respective listeners.
+ /// Broadcasts all previously recorded events to their respective listeners.
///
- /// Returns true if an event was delivered to at least one listener.
+ /// Returns `true` if an event was delivered to at least one listener.
fn broadcast(&self) -> bool {
use crate::sync::mpsc::error::TrySendError;
@@ -136,20 +136,20 @@ impl ops::Deref for Globals {
}
impl Globals {
- /// Register a new listener for `event_id`.
+ /// Registers a new listener for `event_id`.
pub(crate) fn register_listener(&self, event_id: EventId, listener: Sender<()>) {
self.registry.register_listener(event_id, listener);
}
- /// Mark `event_id` as having been delivered, without broadcasting it to
+ /// Marks `event_id` as having been delivered, without broadcasting it to
/// any listeners.
pub(crate) fn record_event(&self, event_id: EventId) {
self.registry.record_event(event_id);
}
- /// Broadcast all previously recorded events to their respective listeners.
+ /// Broadcasts all previously recorded events to their respective listeners.
///
- /// Returns true if an event was delivered to at least one listener.
+ /// Returns `true` if an event was delivered to at least one listener.
pub(crate) fn broadcast(&self) -> bool {
self.registry.broadcast()
}
diff --git a/tokio/src/signal/unix.rs b/tokio/src/signal/unix.rs
index 0500fa19..06f5cf4e 100644
--- a/tokio/src/signal/unix.rs
+++ b/tokio/src/signal/unix.rs
@@ -214,7 +214,7 @@ fn action(globals: Pin<&'static Globals>, signal: c_int) {
drop(sender.write(&[1]));
}
-/// Enable this module to receive signal notifications for the `signal`
+/// Enables this module to receive signal notifications for the `signal`
/// provided.
///
/// This will register the signal handler if it hasn't already been registered,
@@ -243,7 +243,7 @@ fn signal_enable(signal: c_int) -> io::Result<()> {
});
registered?;
// If the call_once failed, it won't be retried on the next attempt to register the signal. In
- // such case it is not run, registered is still `Ok(())`, initialized is still false.
+ // such case it is not run, registered is still `Ok(())`, initialized is still `false`.
if siginfo.initialized.load(Ordering::Relaxed) {
Ok(())
} else {
@@ -421,7 +421,7 @@ pub fn signal(kind: SignalKind) -> io::Result<Signal> {
}
impl Signal {
- /// Receive the next signal notification event.
+ /// Receives the next signal notification event.
///
/// `None` is returned if no more events can be received by this stream.
///
@@ -449,7 +449,7 @@ impl Signal {
poll_fn(|cx| self.poll_recv(cx)).await
}
- /// Poll to receive the next signal notification event, outside of an
+ /// Polls to receive the next signal notification event, outside of an
/// `async` context.
///
/// `None` is returned if no more events can be received by this stream.
diff --git a/tokio/src/signal/windows.rs b/tokio/src/signal/windows.rs
index def1a1d7..f55e504b 100644
--- a/tokio/src/signal/windows.rs
+++ b/tokio/src/signal/windows.rs
@@ -149,7 +149,7 @@ pub struct CtrlBreak {
}
impl CtrlBreak {
- /// Receive the next signal notification event.
+ /// Receives the next signal notification event.
///
/// `None` is returned if no more events can be received by this stream.
///
@@ -175,7 +175,7 @@ impl CtrlBreak {
poll_fn(|cx| self.poll_recv(cx)).await
}
- /// Poll to receive the next signal notification event, outside of an
+ /// Polls to receive the next signal notification event, outside of an
/// `async` context.
///
/// `None` is returned if no more events can be received by this stream.