[−][src]Struct smoltcp::socket::SocketSet
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]
SocketsT: Into<ManagedSlice<'a, Option<Item<'b, 'c>>>>,
Create a socket set using the provided storage.
pub fn add<T>(&mut self, socket: T) -> Handle where
T: Into<Socket<'b, 'c>>,
[src]
T: Into<Socket<'b, 'c>>,
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
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,
'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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,