xarxa

Crates

git

Versions

default

Flavors

Skip to main content

TcpListenerIter

Struct TcpListenerIter 

Source
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>

Source

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.