Trait virtual_net::VirtualUdpSocket

source ·
pub trait VirtualUdpSocket:
    VirtualConnectionlessSocket
    + Debug
    + Send
    + Sync
    + 'static {
Show 13 methods // Required methods fn set_broadcast(&mut self, broadcast: bool) -> Result<()>; fn broadcast(&self) -> Result<bool>; fn set_multicast_loop_v4(&mut self, val: bool) -> Result<()>; fn multicast_loop_v4(&self) -> Result<bool>; fn set_multicast_loop_v6(&mut self, val: bool) -> Result<()>; fn multicast_loop_v6(&self) -> Result<bool>; fn set_multicast_ttl_v4(&mut self, ttl: u32) -> Result<()>; fn multicast_ttl_v4(&self) -> Result<u32>; fn join_multicast_v4( &mut self, multiaddr: Ipv4Addr, iface: Ipv4Addr, ) -> Result<()>; fn leave_multicast_v4( &mut self, multiaddr: Ipv4Addr, iface: Ipv4Addr, ) -> Result<()>; fn join_multicast_v6( &mut self, multiaddr: Ipv6Addr, iface: u32, ) -> Result<()>; fn leave_multicast_v6( &mut self, multiaddr: Ipv6Addr, iface: u32, ) -> Result<()>; fn addr_peer(&self) -> Result<Option<SocketAddr>>;
}

Required Methods§

source

fn set_broadcast(&mut self, broadcast: bool) -> Result<()>

Sets a flag that means that the UDP socket is able to receive and process broadcast packets.

source

fn broadcast(&self) -> Result<bool>

Indicates if the SO_BROADCAST flag is set which means that the UDP socket will receive and process broadcast packets

source

fn set_multicast_loop_v4(&mut self, val: bool) -> Result<()>

Sets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv4 addresses

source

fn multicast_loop_v4(&self) -> Result<bool>

Gets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv4 addresses

source

fn set_multicast_loop_v6(&mut self, val: bool) -> Result<()>

Sets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv6 addresses

source

fn multicast_loop_v6(&self) -> Result<bool>

Gets a flag that indicates if multicast packets that this socket is a member of will be looped back to the sending socket. This applies to IPv6 addresses

source

fn set_multicast_ttl_v4(&mut self, ttl: u32) -> Result<()>

Sets the TTL for IPv4 multicast packets which is the number of network hops before the packet is dropped

source

fn multicast_ttl_v4(&self) -> Result<u32>

Gets the TTL for IPv4 multicast packets which is the number of network hops before the packet is dropped

source

fn join_multicast_v4( &mut self, multiaddr: Ipv4Addr, iface: Ipv4Addr, ) -> Result<()>

Tells this interface that it will subscribe to a particular multicast address. This applies to IPv4 addresses

source

fn leave_multicast_v4( &mut self, multiaddr: Ipv4Addr, iface: Ipv4Addr, ) -> Result<()>

Tells this interface that it will unsubscribe to a particular multicast address. This applies to IPv4 addresses

source

fn join_multicast_v6(&mut self, multiaddr: Ipv6Addr, iface: u32) -> Result<()>

Tells this interface that it will subscribe to a particular multicast address. This applies to IPv6 addresses

source

fn leave_multicast_v6(&mut self, multiaddr: Ipv6Addr, iface: u32) -> Result<()>

Tells this interface that it will unsubscribe to a particular multicast address. This applies to IPv6 addresses

source

fn addr_peer(&self) -> Result<Option<SocketAddr>>

Returns the remote address of this UDP socket if it has been connected to a specific target destination address

Implementors§

source§

impl VirtualUdpSocket for LocalUdpSocket

Available on crate feature host-net only.