pub struct MulticastUdpSocket { /* private fields */ }Expand description
An IPv6 + IPv4 multicast socket that sends payloads generated by user callbacks to all interfaces.
Implementations§
Source§impl MulticastUdpSocket
impl MulticastUdpSocket
pub async fn new( bind_addr: SocketAddr, ipv4_mcast_addr: SocketAddrV4, ipv6_site_local_addr: SocketAddrV6, ipv6_link_local_addr: Option<SocketAddrV6>, bind_device: Option<&BindDevice>, ) -> Result<Self>
pub fn nics(&self) -> &[NetworkInterface]
pub async fn recv_from(&self, buf: &mut [u8]) -> Result<(usize, SocketAddr)>
pub async fn send_to(&self, buf: &[u8], addr: SocketAddr) -> Result<usize>
pub fn find_mcast_opts_for_replying_to( &self, addr: &SocketAddr, ) -> Option<MulticastOpts>
pub async fn send_multicast_msg( &self, buf: &[u8], opts: &MulticastOpts, ) -> Result<usize>
pub async fn try_send_mcast_everywhere( &self, get_payload: &impl Fn(&MulticastOpts) -> Option<String>, )
Auto Trait Implementations§
impl !Freeze for MulticastUdpSocket
impl RefUnwindSafe for MulticastUdpSocket
impl Send for MulticastUdpSocket
impl Sync for MulticastUdpSocket
impl Unpin for MulticastUdpSocket
impl UnwindSafe for MulticastUdpSocket
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