pub struct MulticastConfig {
pub group: IpAddr,
pub port: u16,
pub ttl: u8,
pub interface: Option<IpAddr>,
}Expand description
Multicast group configuration.
Parsed from SDP c=IN IP4 <group>/<ttl> lines or constructed directly
for server-side multicast publishing.
Fields§
§group: IpAddrMulticast group address (e.g. 239.1.1.1).
port: u16RTP port number.
ttl: u8Multicast TTL (time-to-live). Default 1 = link-local.
interface: Option<IpAddr>Optional local interface address to bind to.
Implementations§
Source§impl MulticastConfig
impl MulticastConfig
Sourcepub fn with_interface(self, interface: IpAddr) -> Self
pub fn with_interface(self, interface: IpAddr) -> Self
Set the local interface.
Sourcepub async fn bind(&self) -> Result<UdpSocket>
pub async fn bind(&self) -> Result<UdpSocket>
Create a multicast UDP socket, bind it, and join the group.
The socket is bound to 0.0.0.0:<port> (required for multicast receive)
and joined to the multicast group on the specified or default interface.
Sourcepub fn is_multicast(addr: &IpAddr) -> bool
pub fn is_multicast(addr: &IpAddr) -> bool
Check if an address is a multicast address.
Trait Implementations§
Source§impl Clone for MulticastConfig
impl Clone for MulticastConfig
Source§impl Debug for MulticastConfig
impl Debug for MulticastConfig
impl Eq for MulticastConfig
Source§impl PartialEq for MulticastConfig
impl PartialEq for MulticastConfig
impl StructuralPartialEq for MulticastConfig
Auto Trait Implementations§
impl Forget for MulticastConfig
impl Freeze for MulticastConfig
impl Move for MulticastConfig
impl RefUnwindSafe for MulticastConfig
impl Send for MulticastConfig
impl Sync for MulticastConfig
impl Unpin for MulticastConfig
impl UnsafeUnpin for MulticastConfig
impl UnwindSafe for MulticastConfig
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