pub struct RawPublicationConfig {
pub family: Option<PublicationAddressFamily>,
pub outgoing_interface: Option<OutgoingInterface>,
pub bind_addr: Option<IpAddr>,
pub ttl: Option<u8>,
pub loopback: Option<bool>,
pub validation_mode: RawValidationMode,
}Expand description
Configuration for one raw multicast transmit publication.
Fields§
§family: Option<PublicationAddressFamily>The expected IP family for outbound datagrams, if fixed in advance. Otherwise it is inferred from the local bind or interface selector when the publication is created.
outgoing_interface: Option<OutgoingInterface>The explicit egress interface selector, if set.
bind_addr: Option<IpAddr>The local IP address used to select and validate the egress interface.
The source IP seen by receivers comes from the supplied datagram. This field only identifies a local egress address. A matching IPv6 source can use the host IP stack; a distinct source requires a link-layer backend.
ttl: Option<u8>Optional TTL or hop-limit override applied during transmit.
loopback: Option<bool>Optional loopback preference.
validation_mode: RawValidationModeValidation behavior for outbound datagrams.
Implementations§
Source§impl RawPublicationConfig
impl RawPublicationConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a raw publication config with family inferred from its local bind or outgoing-interface selector.
Sourcepub fn validate(&self) -> Result<(), MctxError>
pub fn validate(&self) -> Result<(), MctxError>
Validates the configuration and returns an error if it is not usable.
Sourcepub fn with_family(self, family: PublicationAddressFamily) -> Self
pub fn with_family(self, family: PublicationAddressFamily) -> Self
Pins the expected IP family for datagrams sent through this publication.
Sourcepub fn with_outgoing_interface(
self,
outgoing_interface: impl Into<OutgoingInterface>,
) -> Self
pub fn with_outgoing_interface( self, outgoing_interface: impl Into<OutgoingInterface>, ) -> Self
Sets the outgoing interface selector.
Sourcepub fn with_interface(self, interface: Ipv4Addr) -> Self
pub fn with_interface(self, interface: Ipv4Addr) -> Self
Sets the IPv4-oriented interface convenience selector.
Sourcepub fn with_ipv6_interface_index(self, interface_index: u32) -> Self
pub fn with_ipv6_interface_index(self, interface_index: u32) -> Self
Sets the IPv6 interface selector by interface index.
Sourcepub fn with_bind_addr(self, bind_addr: impl Into<IpAddr>) -> Self
pub fn with_bind_addr(self, bind_addr: impl Into<IpAddr>) -> Self
Sets the local IP address used to select and validate the egress interface.
Sourcepub fn with_loopback(self, loopback: bool) -> Self
pub fn with_loopback(self, loopback: bool) -> Self
Requests an explicit loopback preference.
Sourcepub fn with_validation_mode(self, validation_mode: RawValidationMode) -> Self
pub fn with_validation_mode(self, validation_mode: RawValidationMode) -> Self
Adjusts outbound datagram validation behavior.
Trait Implementations§
Source§impl Clone for RawPublicationConfig
impl Clone for RawPublicationConfig
Source§fn clone(&self) -> RawPublicationConfig
fn clone(&self) -> RawPublicationConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more