docs: more doc fixes (#2831)

Previous docs look like they were based on the docs for
`insert_at`. Changed names of variables referred to and the
explanation of when the value will be returned and under what
condition it will be immediately available to make sense for a
Duration argument instead of an Instant.
This commit is contained in:
Zephyr Shannon
2020-09-11 12:44:33 -07:00
committed by GitHub
parent be7462e50f
commit ce0af8f7a1
3 changed files with 15 additions and 13 deletions
+1 -1
View File
@@ -406,7 +406,7 @@
//!
//! The remaining synchronization primitives focus on synchronizing state.
//! These are asynchronous equivalents to versions provided by `std`. They
//! operate in a similar way as their `std` counterparts parts but will wait
//! operate in a similar way as their `std` counterparts but will wait
//! asynchronously instead of blocking the thread.
//!
//! * [`Barrier`](Barrier) Ensures multiple tasks will wait for each other to
+1 -1
View File
@@ -11,7 +11,7 @@ const MAX_READS: usize = 32;
#[cfg(loom)]
const MAX_READS: usize = 10;
/// An asynchronous reader-writer lock
/// An asynchronous reader-writer lock.
///
/// This type of lock allows a number of readers or at most one writer at any
/// point in time. The write portion of this lock typically allows modification
+13 -11
View File
@@ -366,23 +366,25 @@ impl<T> DelayQueue<T> {
/// This function is identical to `insert_at`, but takes a `Duration`
/// instead of an `Instant`.
///
/// `value` is stored in the queue until `when` is reached. At which point,
/// `value` will be returned from [`poll_expired`]. If `when` has already been
/// reached, then `value` is immediately made available to poll.
/// `value` is stored in the queue until `timeout` duration has
/// elapsed after `insert` was called. At that point, `value` will
/// be returned from [`poll_expired`]. If `timeout` a Duration of
/// zero, then `value` is immediately made available to poll.
///
/// The return value represents the insertion and is used at an argument to
/// [`remove`] and [`reset`]. Note that [`Key`] is token and is reused once
/// `value` is removed from the queue either by calling [`poll_expired`] after
/// `when` is reached or by calling [`remove`]. At this point, the caller
/// must take care to not use the returned [`Key`] again as it may reference
/// a different item in the queue.
/// The return value represents the insertion and is used as an
/// argument to [`remove`] and [`reset`]. Note that [`Key`] is a
/// token and is reused once `value` is removed from the queue
/// either by calling [`poll_expired`] after `timeout` has elapsed
/// or by calling [`remove`]. At this point, the caller must not
/// use the returned [`Key`] again as it may reference a different
/// item in the queue.
///
/// See [type] level documentation for more details.
///
/// # Panics
///
/// This function panics if `timeout` is greater than the maximum supported
/// duration.
/// This function panics if `timeout` is greater than the maximum
/// duration supported by the timer in the current `Runtime`.
///
/// # Examples
///