mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-27 00:00:12 +02:00
macros: fix select! documentation formatting (#2283)
This commit is contained in:
@@ -4,7 +4,7 @@
|
|||||||
/// The `select!` macro must be used inside of async functions, closures, and
|
/// The `select!` macro must be used inside of async functions, closures, and
|
||||||
/// blocks.
|
/// blocks.
|
||||||
///
|
///
|
||||||
/// The `select` macro accepts one or more branches with the following pattern:
|
/// The `select!` macro accepts one or more branches with the following pattern:
|
||||||
///
|
///
|
||||||
/// ```text
|
/// ```text
|
||||||
/// <pattern> = <async expression> (, if <precondition>)? => <handler>,
|
/// <pattern> = <async expression> (, if <precondition>)? => <handler>,
|
||||||
@@ -24,7 +24,7 @@
|
|||||||
/// expression.
|
/// expression.
|
||||||
///
|
///
|
||||||
/// Additionally, each branch may include an optional `if` precondition. This
|
/// Additionally, each branch may include an optional `if` precondition. This
|
||||||
/// precondition is evaluated **before** the <async expression>. If the
|
/// precondition is evaluated **before** the `<async expression>`. If the
|
||||||
/// precondition returns `false`, the branch is entirely disabled. This
|
/// precondition returns `false`, the branch is entirely disabled. This
|
||||||
/// capability is useful when using `select!` within a loop.
|
/// capability is useful when using `select!` within a loop.
|
||||||
///
|
///
|
||||||
@@ -41,7 +41,7 @@
|
|||||||
/// 4. Once an `<async expression>` returns a value, attempt to apply the value
|
/// 4. Once an `<async expression>` returns a value, attempt to apply the value
|
||||||
/// to the provided `<pattern>`, if the pattern matches, evaluate `<handler>`
|
/// to the provided `<pattern>`, if the pattern matches, evaluate `<handler>`
|
||||||
/// and return. If the pattern **does not** match, disable the current branch
|
/// and return. If the pattern **does not** match, disable the current branch
|
||||||
/// and for the remainder of the current call to `select!. Continue from step 3.
|
/// and for the remainder of the current call to `select!`. Continue from step 3.
|
||||||
/// 5. If **all** branches are disabled, evaluate the `else` expression. If none
|
/// 5. If **all** branches are disabled, evaluate the `else` expression. If none
|
||||||
/// is provided, panic.
|
/// is provided, panic.
|
||||||
///
|
///
|
||||||
@@ -210,7 +210,7 @@
|
|||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
///
|
///
|
||||||
/// Using the same future in multiple select! expressions can be done by passing
|
/// Using the same future in multiple `select!` expressions can be done by passing
|
||||||
/// a reference to the future. Doing so requires the future to be [`Unpin`]. A
|
/// a reference to the future. Doing so requires the future to be [`Unpin`]. A
|
||||||
/// future can be made [`Unpin`] by either using [`Box::pin`] or stack pinning.
|
/// future can be made [`Unpin`] by either using [`Box::pin`] or stack pinning.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user