mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-23 03:56:23 +00:00
37 lines
516 B
Markdown
37 lines
516 B
Markdown
|
---
|
||
|
id: 048ee80a-c058-4a41-8087-9ce3649302ba
|
||
|
title: pending
|
||
|
---
|
||
|
|
||
|
# Description
|
||
|
|
||
|
pending[^1] creates a future which never resovles, representing a
|
||
|
computation that never finishes.
|
||
|
|
||
|
# Declaration
|
||
|
|
||
|
``` rust
|
||
|
pub fn pending<T>() -> Pending<T>
|
||
|
```
|
||
|
|
||
|
# Notable traits
|
||
|
|
||
|
``` rust
|
||
|
impl<T> Future for Pending<T>
|
||
|
type Output = T;
|
||
|
```
|
||
|
|
||
|
# Examples
|
||
|
|
||
|
``` rust
|
||
|
use core::future;
|
||
|
|
||
|
let future = future::pending();
|
||
|
let () = future.await;
|
||
|
unreachable!();
|
||
|
```
|
||
|
|
||
|
# Footnotes
|
||
|
|
||
|
[^1]: <https://doc.rust-lang.org/std/future/fn.pending.html>
|