mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-26 00:34:06 +00:00
split up the first paragraph of doc comments for better summaries
This commit is contained in:
parent
7028d9318f
commit
ae3c68db34
@ -2931,7 +2931,9 @@ impl<T, I: iter::TrustedLen<Item = T>> ToRcSlice<T> for I {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// `Weak` is a version of [`Rc`] that holds a non-owning reference to the
|
/// `Weak` is a version of [`Rc`] that holds a non-owning reference to the
|
||||||
/// managed allocation. The allocation is accessed by calling [`upgrade`] on the `Weak`
|
/// managed allocation.
|
||||||
|
///
|
||||||
|
/// The allocation is accessed by calling [`upgrade`] on the `Weak`
|
||||||
/// pointer, which returns an <code>[Option]<[Rc]\<T>></code>.
|
/// pointer, which returns an <code>[Option]<[Rc]\<T>></code>.
|
||||||
///
|
///
|
||||||
/// Since a `Weak` reference does not count towards ownership, it will not
|
/// Since a `Weak` reference does not count towards ownership, it will not
|
||||||
|
@ -290,7 +290,9 @@ impl<T: ?Sized, A: Allocator> Arc<T, A> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// `Weak` is a version of [`Arc`] that holds a non-owning reference to the
|
/// `Weak` is a version of [`Arc`] that holds a non-owning reference to the
|
||||||
/// managed allocation. The allocation is accessed by calling [`upgrade`] on the `Weak`
|
/// managed allocation.
|
||||||
|
///
|
||||||
|
/// The allocation is accessed by calling [`upgrade`] on the `Weak`
|
||||||
/// pointer, which returns an <code>[Option]<[Arc]\<T>></code>.
|
/// pointer, which returns an <code>[Option]<[Arc]\<T>></code>.
|
||||||
///
|
///
|
||||||
/// Since a `Weak` reference does not count towards ownership, it will not
|
/// Since a `Weak` reference does not count towards ownership, it will not
|
||||||
|
@ -176,9 +176,11 @@ fn raw_waker<W: Wake + Send + Sync + 'static>(waker: Arc<W>) -> RawWaker {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// An analogous trait to `Wake` but used to construct a `LocalWaker`. This API
|
/// An analogous trait to `Wake` but used to construct a `LocalWaker`.
|
||||||
/// works in exactly the same way as `Wake`, except that it uses an `Rc` instead
|
///
|
||||||
/// of an `Arc`, and the result is a `LocalWaker` instead of a `Waker`.
|
/// This API works in exactly the same way as `Wake`,
|
||||||
|
/// except that it uses an `Rc` instead of an `Arc`,
|
||||||
|
/// and the result is a `LocalWaker` instead of a `Waker`.
|
||||||
///
|
///
|
||||||
/// The benefits of using `LocalWaker` over `Waker` are that it allows the local waker
|
/// The benefits of using `LocalWaker` over `Waker` are that it allows the local waker
|
||||||
/// to hold data that does not implement `Send` and `Sync`. Additionally, it saves calls
|
/// to hold data that does not implement `Send` and `Sync`. Additionally, it saves calls
|
||||||
|
@ -153,6 +153,7 @@ use crate::panic::{RefUnwindSafe, UnwindSafe};
|
|||||||
use crate::time::{Duration, Instant};
|
use crate::time::{Duration, Instant};
|
||||||
|
|
||||||
/// Creates a new asynchronous channel, returning the sender/receiver halves.
|
/// Creates a new asynchronous channel, returning the sender/receiver halves.
|
||||||
|
///
|
||||||
/// All data sent on the [`Sender`] will become available on the [`Receiver`] in
|
/// All data sent on the [`Sender`] will become available on the [`Receiver`] in
|
||||||
/// the same order as it was sent, and no [`send`] will block the calling thread
|
/// the same order as it was sent, and no [`send`] will block the calling thread
|
||||||
/// (this channel has an "infinite buffer", unlike [`sync_channel`], which will
|
/// (this channel has an "infinite buffer", unlike [`sync_channel`], which will
|
||||||
@ -201,6 +202,7 @@ pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new synchronous, bounded channel.
|
/// Creates a new synchronous, bounded channel.
|
||||||
|
///
|
||||||
/// All data sent on the [`Sender`] will become available on the [`Receiver`]
|
/// All data sent on the [`Sender`] will become available on the [`Receiver`]
|
||||||
/// in the same order as it was sent. Like asynchronous [`channel`]s, the
|
/// in the same order as it was sent. Like asynchronous [`channel`]s, the
|
||||||
/// [`Receiver`] will block until a message becomes available. `sync_channel`
|
/// [`Receiver`] will block until a message becomes available. `sync_channel`
|
||||||
|
@ -483,6 +483,7 @@ pub enum TrySendError<T> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new asynchronous channel, returning the sender/receiver halves.
|
/// Creates a new asynchronous channel, returning the sender/receiver halves.
|
||||||
|
///
|
||||||
/// All data sent on the [`Sender`] will become available on the [`Receiver`] in
|
/// All data sent on the [`Sender`] will become available on the [`Receiver`] in
|
||||||
/// the same order as it was sent, and no [`send`] will block the calling thread
|
/// the same order as it was sent, and no [`send`] will block the calling thread
|
||||||
/// (this channel has an "infinite buffer", unlike [`sync_channel`], which will
|
/// (this channel has an "infinite buffer", unlike [`sync_channel`], which will
|
||||||
@ -527,6 +528,7 @@ pub fn channel<T>() -> (Sender<T>, Receiver<T>) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Creates a new synchronous, bounded channel.
|
/// Creates a new synchronous, bounded channel.
|
||||||
|
///
|
||||||
/// All data sent on the [`SyncSender`] will become available on the [`Receiver`]
|
/// All data sent on the [`SyncSender`] will become available on the [`Receiver`]
|
||||||
/// in the same order as it was sent. Like asynchronous [`channel`]s, the
|
/// in the same order as it was sent. Like asynchronous [`channel`]s, the
|
||||||
/// [`Receiver`] will block until a message becomes available. `sync_channel`
|
/// [`Receiver`] will block until a message becomes available. `sync_channel`
|
||||||
|
Loading…
Reference in New Issue
Block a user