aws_smithy_async/future/never.rs
1/*
2 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6//! Provides the [`Never`] future that never completes.
7
8use std::future::Future;
9use std::pin::Pin;
10use std::task::{Context, Poll};
11
12/// Future that never completes.
13#[non_exhaustive]
14#[derive(Default, Debug)]
15pub struct Never;
16
17impl Never {
18 /// Create a new `Never` future that never resolves
19 pub fn new() -> Never {
20 Default::default()
21 }
22}
23
24impl Future for Never {
25 type Output = ();
26
27 fn poll(self: Pin<&mut Self>, _cx: &mut Context<'_>) -> Poll<Self::Output> {
28 Poll::Pending
29 }
30}