Struct ublox_sockets::SocketSet
source · [−]pub struct SocketSet<const TIMER_HZ: u32, const N: usize, const L: usize> {
pub sockets: Vec<Option<Socket<TIMER_HZ, L>>, N>,
}
Expand description
An extensible set of sockets.
Fields
sockets: Vec<Option<Socket<TIMER_HZ, L>>, N>
Implementations
sourceimpl<const TIMER_HZ: u32, const N: usize, const L: usize> Set<TIMER_HZ, N, L>
impl<const TIMER_HZ: u32, const N: usize, const L: usize> Set<TIMER_HZ, N, L>
sourcepub fn socket_type(&self, handle: Handle) -> Option<SocketType>
pub fn socket_type(&self, handle: Handle) -> Option<SocketType>
Get the type of a specific socket in the set.
Returned as a SocketType
sourcepub fn add<T>(&mut self, socket: T) -> Result<Handle, Error>where
T: Into<Socket<TIMER_HZ, L>>,
pub fn add<T>(&mut self, socket: T) -> Result<Handle, Error>where
T: Into<Socket<TIMER_HZ, L>>,
Add a socket to the set with the reference count 1, and return its handle.
sourcepub fn get<T: AnySocket<TIMER_HZ, L>>(
&mut self,
handle: Handle
) -> Result<SocketRef<'_, T>, Error>
pub fn get<T: AnySocket<TIMER_HZ, L>>(
&mut self,
handle: Handle
) -> Result<SocketRef<'_, T>, Error>
Get a socket from the set by its handle, as mutable.
pub fn recycle(&mut self, ts: Instant<TIMER_HZ>) -> bool
Trait Implementations
Auto Trait Implementations
impl<const TIMER_HZ: u32, const N: usize, const L: usize> RefUnwindSafe for Set<TIMER_HZ, N, L>
impl<const TIMER_HZ: u32, const N: usize, const L: usize> Send for Set<TIMER_HZ, N, L>
impl<const TIMER_HZ: u32, const N: usize, const L: usize> Sync for Set<TIMER_HZ, N, L>
impl<const TIMER_HZ: u32, const N: usize, const L: usize> Unpin for Set<TIMER_HZ, N, L>
impl<const TIMER_HZ: u32, const N: usize, const L: usize> UnwindSafe for Set<TIMER_HZ, N, L>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more