Vendor dependencies

This commit is contained in:
2026-08-01 16:11:49 +03:00
parent 7f139a0241
commit 6b5e7f0f8b
29706 changed files with 9575646 additions and 0 deletions
@@ -0,0 +1,31 @@
use std::{
future::Future,
pin::Pin,
task::{Context, Poll},
};
/// A Future which yields to the executor for a given amount of iterations
/// and resolves after this
pub struct Yield {
iter: usize,
}
impl Yield {
pub fn new(iter: usize) -> Yield {
Yield { iter }
}
}
impl Future for Yield {
type Output = ();
fn poll(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<()> {
if self.iter == 0 {
Poll::Ready(())
} else {
self.iter -= 1;
cx.waker().wake_by_ref();
Poll::Pending
}
}
}