fn shutdown_list<TMessage, TSubstream>
	(list: &mut SmallVec<impl smallvec::Array<Item = RegisteredProtocolSubstream<TMessage, TSubstream>>>)
where TSubstream: AsyncRead + AsyncWrite, TMessage: CustomMessage {
	'outer: for n in (0..list.len()).rev() {
		let mut substream = list.swap_remove(n);
		loop {
			match substream.poll() {
				Ok(Async::Ready(Some(_))) => {}
				Ok(Async::NotReady) => break,
				Err(_) | Ok(Async::Ready(None)) => continue 'outer,
			}
		}
		list.push(substream);
	}
}
/// Given a list of substreams, tries to shut them down. The substreams that have been successfully
/// shut down are removed from the list.
Given a list of substreams, tries to shut them down. The substreams that have been successfully
shut down are removed from the list.
Given a list of substreams tries to shut them down . The substreams that have been successfully shut down are removed from the list .
fn shutdown_list<TMessage, TSubstream>
	(list: &mut SmallVec<impl smallvec::Array<Item = RegisteredProtocolSubstream<TMessage, TSubstream>>>)
where TSubstream: AsyncRead + AsyncWrite, TMessage: CustomMessage {
	'outer: for n in (0..list.len()).rev() {
		let mut substream = list.swap_remove(n);
		loop {
			match substream.poll() {
				Ok(Async::Ready(Some(_))) => {}
				Ok(Async::NotReady) => break,
				Err(_) | Ok(Async::Ready(None)) => continue 'outer,
			}
		}
		list.push(substream);
	}
}
fn shutdown_list < TMessage , TSubstream > ( list : & mut SmallVec < impl smallvec :: Array < Item = RegisteredProtocolSubstream < TMessage , TSubstream > > > ) where TSubstream : AsyncRead + AsyncWrite , TMessage : CustomMessage { ' outer : for n in ( 0 .. list . len ( ) ) . rev ( ) { let mut substream = list . swap_remove ( n ) ; loop { match substream . poll ( ) { Ok ( Async :: Ready ( Some ( _ ) ) ) => { } Ok ( Async :: NotReady ) => break , Err ( _ ) | Ok ( Async :: Ready ( None ) ) => continue ' outer , } } list . push ( substream ) ; } }
Given a list of substreams, tries to shut them down.
Given a list of substreams tries to shut them down .
list
&mut SmallVec<impl smallvec::Array<Item = RegisteredProtocolSubstream<TMessage, TSubstream>>>
list
&mut SmallVec<impl smallvec::Array<Item = RegisteredProtocolSubstream<TMessage, TSubstream>>>