kernel_api/syscall/
mod.rs1#[deprecated = "use the items in the `syscall` module root instead"]
4pub mod handle {
5 pub use super::handle_inner::*;
7}
8
9#[deprecated = "use the items in the `syscall` module root instead"]
10pub mod server {
11 pub use super::server_inner::*;
13}
14
15mod result;
16mod handle_inner;
17mod server_inner;
18
19pub use result::*;
20pub use handle_inner::*;
21pub use server_inner::*;
22
23use crate::channel;
24use crate::channel::Receiver;
25
26#[derive(Debug)]
30pub struct AsyncMap {
31 #[doc(hidden)]
32 pub queue: Receiver<(usize, Result<u128>)>,
33}
34
35impl AsyncMap {
36 #[must_use]
46 pub fn new() -> Self {
47 Self {
48 queue: channel::unbounded().1,
49 }
50 }
51
52 pub fn push_result(&self, key: usize, result: Result<u128>) {
63 self.queue.push((key, result));
64 }
65}
66
67impl Default for AsyncMap {
68 fn default() -> Self {
69 Self::new()
70 }
71}