pub struct Outputs<T, const N: usize = 0> { /* private fields */ }Implementations§
Source§impl<T, const N: usize> Outputs<T, N>
impl<T, const N: usize> Outputs<T, N>
pub fn is_open(&self) -> bool
pub fn is_closed(&self) -> bool
pub fn capacity(&self) -> Option<usize>
pub fn max_capacity(&self) -> Option<usize>
pub fn close(&mut self)
Sourcepub async fn send(&self, value: T) -> Result<(), SendError>
pub async fn send(&self, value: T) -> Result<(), SendError>
Examples found in repository?
More examples
examples/basic.rs (line 9)
5pub async fn main() {
6 let (outputs, mut inputs) = async_flow::Channel::bounded(1).into_inner();
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 send_blocking(&self, value: T) -> Result<(), SendError>
Trait Implementations§
Source§impl<T, const N: usize> MaybeLabeled for Outputs<T, N>
impl<T, const N: usize> MaybeLabeled for Outputs<T, N>
Source§impl<T, const N: usize> MaybeNamed for Outputs<T, N>
impl<T, const N: usize> MaybeNamed for Outputs<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Outputs<T, N>
impl<T, const N: usize> RefUnwindSafe for Outputs<T, N>
impl<T, const N: usize> Send for Outputs<T, N>where
T: Send,
impl<T, const N: usize> Sync for Outputs<T, N>where
T: Send,
impl<T, const N: usize> Unpin for Outputs<T, N>
impl<T, const N: usize> UnwindSafe for Outputs<T, N>
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