FromStream for ()
parent
6ab154be7c
commit
6bc3cd0ab2
@ -0,0 +1,16 @@
|
||||
use std::pin::Pin;
|
||||
|
||||
use crate::prelude::*;
|
||||
use crate::stream::{FromStream, IntoStream};
|
||||
|
||||
impl FromStream<()> for () {
|
||||
#[inline]
|
||||
fn from_stream<'a, S: IntoStream<Item = ()>>(
|
||||
stream: S,
|
||||
) -> Pin<Box<dyn core::future::Future<Output = Self> + 'a>>
|
||||
where
|
||||
<S as IntoStream>::IntoStream: 'a,
|
||||
{
|
||||
Box::pin(stream.into_stream().for_each(|_| ()))
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
//! The Rust primitive `()` type, sometimes called "unit" or "nil".
|
||||
//!
|
||||
//! This module provides types and implementations for working
|
||||
//! asynchronously with values of type `()`.
|
||||
|
||||
mod from_stream;
|
Loading…
Reference in New Issue