pub struct TcpListenerIter<'a, 'd> { /* private fields */ }Expand description
Iterator over the TCP listeners of a Stack, returned by Stack::tcp_listeners.
Each item borrows the stack, so only one can exist at a time. That is why this is
not an Iterator and cannot be used in a for loop. Use while let:
let mut iter = stack.tcp_listeners();
while let Some((handle, item)) = iter.next() {
let _ = (handle, item.is_open());
}Implementations§
Source§impl<'d> TcpListenerIter<'_, 'd>
impl<'d> TcpListenerIter<'_, 'd>
Sourcepub fn next(&mut self) -> Option<(TcpListenerHandle, TcpListener<'_, 'd>)>
pub fn next(&mut self) -> Option<(TcpListenerHandle, TcpListener<'_, 'd>)>
Get the next TCP listener, with its handle.
Returns None when there are no more.
Auto Trait Implementations§
impl<'a, 'd> !RefUnwindSafe for TcpListenerIter<'a, 'd>
impl<'a, 'd> !Send for TcpListenerIter<'a, 'd>
impl<'a, 'd> !Sync for TcpListenerIter<'a, 'd>
impl<'a, 'd> !UnwindSafe for TcpListenerIter<'a, 'd>
impl<'a, 'd> Freeze for TcpListenerIter<'a, 'd>
impl<'a, 'd> Unpin for TcpListenerIter<'a, 'd>
impl<'a, 'd> UnsafeUnpin for TcpListenerIter<'a, 'd>
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