Trait MulticastSocket

Source
pub trait MulticastSocket: DatagramSocketTypes {
    type IpAddr;

    // Required methods
    fn join_multicast<A>(&self, addr: A) -> Result<(), Self::Error>
       where A: Into<Self::IpAddr>;
    fn leave_multicast<A>(&self, addr: A) -> Result<(), Self::Error>
       where A: Into<Self::IpAddr>;
}
Expand description

Trait that provides methods for joining/leaving multicast groups.

Required Associated Types§

Source

type IpAddr

The “address” type for this socket.

Note that this is different than a SocketAddr, which also includes a port number. This is just the address.

Required Methods§

Source

fn join_multicast<A>(&self, addr: A) -> Result<(), Self::Error>
where A: Into<Self::IpAddr>,

Attempts to join the given multicast group.

Source

fn leave_multicast<A>(&self, addr: A) -> Result<(), Self::Error>
where A: Into<Self::IpAddr>,

Attempts to leave the given multicast group.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§