[][src]Struct smoltcp::socket::SocketSet

pub struct SocketSet<'a, 'b: 'a, 'c: 'a + 'b> { /* fields omitted */ }

An extensible set of sockets.

The lifetimes 'b and 'c are used when storing a Socket<'b, 'c>.

Methods

impl<'a, 'b: 'a, 'c: 'a + 'b> Set<'a, 'b, 'c>[src]

pub fn new<SocketsT>(sockets: SocketsT) -> Set<'a, 'b, 'c> where
    SocketsT: Into<ManagedSlice<'a, Option<Item<'b, 'c>>>>, 
[src]

Create a socket set using the provided storage.

pub fn add<T>(&mut self, socket: T) -> Handle where
    T: Into<Socket<'b, 'c>>, 
[src]

Add a socket to the set with the reference count 1, and return its handle.

Panics

This function panics if the storage is fixed-size (not a Vec) and is full.

pub fn get<T: AnySocket<'b, 'c>>(&mut self, handle: Handle) -> SocketRef<T>[src]

Get a socket from the set by its handle, as mutable.

Panics

This function may panic if the handle does not belong to this socket set or the socket has the wrong type.

pub fn remove(&mut self, handle: Handle) -> Socket<'b, 'c>[src]

Remove a socket from the set, without changing its state.

Panics

This function may panic if the handle does not belong to this socket set.

pub fn retain(&mut self, handle: Handle)[src]

Increase reference count by 1.

Panics

This function may panic if the handle does not belong to this socket set.

pub fn release(&mut self, handle: Handle)[src]

Decrease reference count by 1.

Panics

This function may panic if the handle does not belong to this socket set, or if the reference count is already zero.

pub fn prune(&mut self)[src]

Prune the sockets in this set.

Pruning affects sockets with reference count 0. Open sockets are closed. Closed sockets are removed and dropped.

Important traits for Iter<'a, 'b, 'c>
pub fn iter<'d>(&'d self) -> Iter<'d, 'b, 'c>[src]

Iterate every socket in this set.

Important traits for IterMut<'a, 'b, 'c>
pub fn iter_mut<'d>(&'d mut self) -> IterMut<'d, 'b, 'c>[src]

Iterate every socket in this set, as SocketRef.

Trait Implementations

impl<'a, 'b: 'a, 'c: 'a + 'b> Debug for Set<'a, 'b, 'c>[src]

Auto Trait Implementations

impl<'a, 'b, 'c> RefUnwindSafe for Set<'a, 'b, 'c>

impl<'a, 'b, 'c> Send for Set<'a, 'b, 'c>

impl<'a, 'b, 'c> Sync for Set<'a, 'b, 'c>

impl<'a, 'b, 'c> Unpin for Set<'a, 'b, 'c> where
    'b: 'a,
    'c: 'a, 

impl<'a, 'b, 'c> !UnwindSafe for Set<'a, 'b, 'c>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.