mirror of
				https://github.com/async-rs/async-std.git
				synced 2025-10-31 08:46:38 +00:00 
			
		
		
		
	* Cleanup: replace cfg-if with our macros * Prefix macros with cfg_ * Remove #[macro_export] from internal macros
		
			
				
	
	
		
			24 lines
		
	
	
	
		
			836 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
	
		
			836 B
		
	
	
	
		
			Rust
		
	
	
	
	
	
| use crate::stream::Stream;
 | |
| 
 | |
| use std::pin::Pin;
 | |
| use std::task::{Context, Poll};
 | |
| 
 | |
| /// A stream able to yield elements from both ends.
 | |
| ///
 | |
| /// Something that implements `DoubleEndedStream` has one extra capability
 | |
| /// over something that implements [`Stream`]: the ability to also take
 | |
| /// `Item`s from the back, as well as the front.
 | |
| ///
 | |
| /// [`Stream`]: trait.Stream.html
 | |
| #[cfg(feature = "unstable")]
 | |
| #[cfg_attr(feature = "docs", doc(cfg(unstable)))]
 | |
| pub trait DoubleEndedStream: Stream {
 | |
|     /// Removes and returns an element from the end of the stream.
 | |
|     ///
 | |
|     /// Returns `None` when there are no more elements.
 | |
|     ///
 | |
|     /// The [trait-level] docs contain more details.
 | |
|     ///
 | |
|     /// [trait-level]: trait.DoubleEndedStream.html
 | |
|     fn poll_next_back(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<Self::Item>>;
 | |
| }
 |