pub struct UdpSuperSocket { /* private fields */ }Expand description
Implementation of SuperSocket trait for stdlib UDP socket on IPV4
Implementations§
Trait Implementations§
Source§impl Default for UdpSuperSocket
impl Default for UdpSuperSocket
Source§fn default() -> UdpSuperSocket
fn default() -> UdpSuperSocket
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for UdpSuperSocket
impl<'de> Deserialize<'de> for UdpSuperSocket
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for UdpSuperSocket
impl Serialize for UdpSuperSocket
Source§impl SuperSocket for UdpSuperSocket
impl SuperSocket for UdpSuperSocket
Source§fn open(&mut self, _ctx: &ControllerCtx) -> Result<(), String>
fn open(&mut self, _ctx: &ControllerCtx) -> Result<(), String>
Do any required stateful one-time setup
Source§fn send(&mut self, id: PeripheralId, msg: &[u8]) -> Result<(), String>
fn send(&mut self, id: PeripheralId, msg: &[u8]) -> Result<(), String>
Send a packet to a specific peripheral
Source§fn recv(&mut self) -> Option<(Option<PeripheralId>, Instant, &[u8])>
fn recv(&mut self) -> Option<(Option<PeripheralId>, Instant, &[u8])>
Receive a packet, if available, along with the associated
a timestamp indicating when the packet was received.
Source§fn broadcast(&mut self, msg: &[u8]) -> Result<(), String>
fn broadcast(&mut self, msg: &[u8]) -> Result<(), String>
Send a packet to every reachable peripheral
Source§fn update_map(&mut self, id: PeripheralId)
fn update_map(&mut self, id: PeripheralId)
Update address map to associate the most recent address that
provided a packet via recv() with a peripheral id.
Auto Trait Implementations§
impl Freeze for UdpSuperSocket
impl RefUnwindSafe for UdpSuperSocket
impl Send for UdpSuperSocket
impl Sync for UdpSuperSocket
impl Unpin for UdpSuperSocket
impl UnwindSafe for UdpSuperSocket
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more