pub struct Inputs<T> { /* private fields */ }Implementations§
Source§impl<T> Inputs<T>
impl<T> Inputs<T>
pub fn is_open(&self) -> bool
pub fn is_closed(&self) -> bool
pub fn is_empty(&self) -> bool
pub fn capacity(&self) -> Option<usize>
pub fn max_capacity(&self) -> Option<usize>
pub fn close(&mut self)
pub async fn recv_all(&mut self) -> Result<Vec<T>, RecvError>
Sourcepub async fn recv(&mut self) -> Result<Option<T>, RecvError>
pub async fn recv(&mut self) -> Result<Option<T>, RecvError>
Examples found in repository?
More examples
examples/basic.rs (line 13)
5pub async fn main() {
6 let (outputs, mut inputs) = async_flow::bounded(1);
7
8 tokio::spawn(async move {
9 outputs.send("value1").await.unwrap();
10 outputs.send("value2").await.unwrap();
11 });
12
13 while let Some(message) = inputs.recv().await.unwrap() {
14 eprintln!("recv: {}", message);
15 }
16}pub fn recv_blocking(&mut self) -> Result<Option<T>, RecvError>
Trait Implementations§
Source§impl<T> MaybeLabeled for Inputs<T>
impl<T> MaybeLabeled for Inputs<T>
Source§impl<T> MaybeNamed for Inputs<T>
impl<T> MaybeNamed for Inputs<T>
Auto Trait Implementations§
impl<T> Freeze for Inputs<T>
impl<T> RefUnwindSafe for Inputs<T>
impl<T> Send for Inputs<T>where
T: Send,
impl<T> Sync for Inputs<T>where
T: Send,
impl<T> Unpin for Inputs<T>
impl<T> UnwindSafe for Inputs<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more