Skip to main content

RawPublicationConfig

Struct RawPublicationConfig 

Source
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: RawValidationMode

Validation behavior for outbound datagrams.

Implementations§

Source§

impl RawPublicationConfig

Source

pub fn new() -> Self

Creates a raw publication config with family inferred from its local bind or outgoing-interface selector.

Source

pub fn ipv4() -> Self

Creates a config fixed to IPv4 datagrams.

Source

pub fn ipv6() -> Self

Creates a config fixed to IPv6 datagrams.

Source

pub fn validate(&self) -> Result<(), MctxError>

Validates the configuration and returns an error if it is not usable.

Source

pub fn with_family(self, family: PublicationAddressFamily) -> Self

Pins the expected IP family for datagrams sent through this publication.

Source

pub fn with_outgoing_interface( self, outgoing_interface: impl Into<OutgoingInterface>, ) -> Self

Sets the outgoing interface selector.

Source

pub fn with_interface(self, interface: Ipv4Addr) -> Self

Sets the IPv4-oriented interface convenience selector.

Source

pub fn with_ipv6_interface_index(self, interface_index: u32) -> Self

Sets the IPv6 interface selector by interface index.

Source

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.

Source

pub fn with_ttl(self, ttl: u8) -> Self

Sets an optional TTL or hop-limit override.

Source

pub fn with_loopback(self, loopback: bool) -> Self

Requests an explicit loopback preference.

Source

pub fn with_validation_mode(self, validation_mode: RawValidationMode) -> Self

Adjusts outbound datagram validation behavior.

Trait Implementations§

Source§

impl Clone for RawPublicationConfig

Source§

fn clone(&self) -> RawPublicationConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RawPublicationConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RawPublicationConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for RawPublicationConfig

Source§

impl Hash for RawPublicationConfig

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for RawPublicationConfig

Source§

fn eq(&self, other: &RawPublicationConfig) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RawPublicationConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.