W3cubDocs

/Rust

Function std::future::pending

pub fn pending<T>() -> Pending<T>ⓘNotable traits for Pending<T>impl<T> Future for Pending<T>    type Output = T;
đŸ”¬ This is a nightly-only experimental API. (future_readiness_fns #70921)

Creates a future which never resolves, representing a computation that never finishes.

Examples

#![feature(future_readiness_fns)]
use core::future;

let future = future::pending();
let () = future.await;
unreachable!();

© 2010 The Rust Project Developers
Licensed under the Apache License, Version 2.0 or the MIT license, at your option.
https://doc.rust-lang.org/std/future/fn.pending.html