Struct smoltcp::socket::SocketSet
[−]
[src]
pub struct SocketSet<'a, 'b: 'a, 'c: 'a + 'b> { /* fields omitted */ }
An extensible set of sockets, with stable numeric identifiers.
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]
fn new<SocketsT>(sockets: SocketsT) -> Set<'a, 'b, 'c> where SocketsT: Into<ManagedSlice<'a, Option<Item<'b, 'c>>>>
Create a socket set using the provided storage.
fn add(&mut self, socket: Socket<'b, 'c>) -> Handle
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.
fn get(&self, handle: Handle) -> &Socket<'b, 'c>
Get a socket from the set by its handle.
Panics
This function may panic if the handle does not belong to this socket set.
fn get_mut(&mut self, handle: Handle) -> &mut Socket<'b, 'c>
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.
fn remove(&mut self, handle: Handle) -> Socket<'b, 'c>
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.
fn retain(&mut self, handle: Handle)
Increase reference count by 1.
Panics
This function may panic if the handle does not belong to this socket set.
fn release(&mut self, handle: Handle)
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.
fn prune(&mut self)
Prune the sockets in this set.
Pruning affects sockets with reference count 0. Open sockets are closed. Closed sockets are removed and dropped.
fn iter<'d>(&'d self) -> Iter<'d, 'b, 'c>
Iterate every socket in this set.
fn iter_mut<'d>(&'d mut self) -> IterMut<'d, 'b, 'c>
Iterate every socket in this set, as mutable.