mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-05 03:30:03 +00:00
Impl Future
for AutoAbortJoinHandle
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
52210d1a8c
commit
f41391a53c
1 changed files with 11 additions and 0 deletions
|
@ -1,8 +1,11 @@
|
|||
use std::{
|
||||
fs,
|
||||
future::Future,
|
||||
io::{self, stderr, stdin, Write},
|
||||
ops::{Deref, DerefMut},
|
||||
path::{Path, PathBuf},
|
||||
pin::Pin,
|
||||
task::{Context, Poll},
|
||||
};
|
||||
|
||||
use bytes::Bytes;
|
||||
|
@ -326,3 +329,11 @@ impl<T> DerefMut for AutoAbortJoinHandle<T> {
|
|||
&mut self.0
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Future for AutoAbortJoinHandle<T> {
|
||||
type Output = Result<T, task::JoinError>;
|
||||
|
||||
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
|
||||
Pin::new(&mut Pin::into_inner(self).0).poll(cx)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue