async_flow/io/input_port.rs
1// This is free and unencumbered software released into the public domain.
2
3use crate::io::{Port, RecvError};
4use alloc::boxed::Box;
5
6#[async_trait::async_trait]
7pub trait InputPort<T>: Port<T> {
8 /// Checks if a port is empty.
9 fn is_empty(&self) -> bool;
10
11 async fn recv(&mut self) -> Result<Option<T>, RecvError>;
12
13 // TODO: recv_event
14 // TODO: recv_deadline
15 // TODO: recv_timeout
16 // TODO: try_recv
17 // TODO: into_stream
18}