[−][src]Struct ublox_cellular::sockets::SocketSet
An extensible set of sockets.
Fields
sockets: Vec<Option<Item<L>>, N>
Implementations
impl<N, L> Set<N, L> where
N: ArrayLength<Option<Item<L>>>,
L: ArrayLength<u8>,
[src]
N: ArrayLength<Option<Item<L>>>,
L: ArrayLength<u8>,
pub fn new() -> Set<N, L>
[src]
Create a socket set using the provided storage.
pub fn capacity(&self) -> usize
[src]
Get the maximum number of sockets the set can hold
pub fn len(&self) -> usize
[src]
Get the current number of initialized sockets, the set is holding
pub fn is_empty(&self) -> bool
[src]
Check if the set is currently holding no active sockets
pub fn socket_type(&self, handle: Handle) -> Option<SocketType>
[src]
Get the type of a specific socket in the set.
Returned as a SocketType
pub fn add<T>(&mut self, socket: T) -> Result<Handle, Error> where
T: Into<Socket<L>>,
[src]
T: Into<Socket<L>>,
Add a socket to the set with the reference count 1, and return its handle.
pub fn get<T: AnySocket<L>>(
&mut self,
handle: Handle
) -> Result<SocketRef<'_, T>, Error>
[src]
&mut self,
handle: Handle
) -> Result<SocketRef<'_, T>, Error>
Get a socket from the set by its handle, as mutable.
pub fn remove(&mut self, handle: Handle) -> Result<Socket<L>, Error>
[src]
Remove a socket from the set, without changing its state.
pub fn retain(&mut self, handle: Handle) -> Result<(), Error>
[src]
Increase reference count by 1.
pub fn release(&mut self, handle: Handle) -> Result<(), Error>
[src]
Decrease reference count by 1.
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.
pub fn iter(&self) -> impl Iterator<Item = (Handle, &Socket<L>)>
[src]
Iterate every socket in this set.
pub fn iter_mut(
&mut self
) -> impl Iterator<Item = (Handle, SocketRef<'_, Socket<L>>)>
[src]
&mut self
) -> impl Iterator<Item = (Handle, SocketRef<'_, Socket<L>>)>
Iterate every socket in this set, as SocketRef.
Trait Implementations
impl<N: Default, L: Default> Default for Set<N, L> where
N: ArrayLength<Option<Item<L>>>,
L: ArrayLength<u8>,
[src]
N: ArrayLength<Option<Item<L>>>,
L: ArrayLength<u8>,
Auto Trait Implementations
impl<N, L> RefUnwindSafe for Set<N, L> where
<N as ArrayLength<Option<Item<L>>>>::ArrayType: RefUnwindSafe,
<N as ArrayLength<Option<Item<L>>>>::ArrayType: RefUnwindSafe,
impl<N, L> Send for Set<N, L>
impl<N, L> Sync for Set<N, L>
impl<N, L> Unpin for Set<N, L> where
<N as ArrayLength<Option<Item<L>>>>::ArrayType: Unpin,
<N as ArrayLength<Option<Item<L>>>>::ArrayType: Unpin,
impl<N, L> UnwindSafe for Set<N, L> where
<N as ArrayLength<Option<Item<L>>>>::ArrayType: UnwindSafe,
<N as ArrayLength<Option<Item<L>>>>::ArrayType: UnwindSafe,
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,
pub 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> Same<T> for T
[src]
type Output = T
Should always be Self
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.
pub 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>,