fn main() {
let pipe_path = Path::new("buffer-dir");
let mut p1 = HyperPipe::new(pipe_path).unwrap();
let v1 = vec![1, 2, 3, 4, 5, 6];
p1.push(v1.clone()).unwrap();
let mut p2 = HyperPipe::new(pipe_path).unwrap();
let v2 = p2.pull().unwrap();
assert_eq!(v1, v2);
}
Remember to wake yourself
pub struct AsyncHyperPipe {
inner: HyperPipe
}
impl Future for AsyncHyperPipe {
type Output = Vec<u8>;
fn poll(self: Pin<&mut Self>, ctx: &mut Context) -> Poll<Self::Output> {
todo!()
}
}
let pipe = AsyncHypePipe::new();
if let Some(data) = pipe.await {
println("hmmm,,, data: {:?}", data);
}