Skip to main content

SubscriptionConfig

Struct SubscriptionConfig 

Source
pub struct SubscriptionConfig {
    pub group: IpAddr,
    pub source: SourceFilter,
    pub dst_port: u16,
    pub interface: Option<IpAddr>,
    pub interface_index: Option<u32>,
}
Expand description

Configuration for a multicast receive subscription.

This defines the multicast group, source filtering mode (ASM or SSM), destination port, and optionally the local interface to join on.

Fields§

§group: IpAddr

The destination multicast group to join.

§source: SourceFilter

The source filtering mode for the subscription.

§dst_port: u16

The destination UDP port to receive on.

§interface: Option<IpAddr>

The local interface address to join on, if explicitly specified.

§interface_index: Option<u32>

The local IPv6 interface index to join on, if explicitly specified.

This is primarily useful for scoped/link-local IPv6 multicast where an interface address alone may be ambiguous across multiple adapters.

Implementations§

Source§

impl SubscriptionConfig

Source

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

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

Source

pub fn family(&self) -> SubscriptionAddressFamily

Returns the configured address family.

Source

pub fn is_ipv4(&self) -> bool

Returns true when this is an IPv4 subscription.

Source

pub fn is_ipv6(&self) -> bool

Returns true when this is an IPv6 subscription.

Source

pub fn source_addr(&self) -> Option<IpAddr>

Returns the configured source address, if any.

Source

pub fn asm(group: Ipv4Addr, port: u16) -> Self

Creates an ASM ((*, G)) subscription configuration.

Source

pub fn asm_v6(group: Ipv6Addr, port: u16) -> Self

Creates an IPv6 ASM ((*, G)) subscription configuration.

Source

pub fn asm_ip(group: IpAddr, port: u16) -> Self

Creates an ASM ((*, G)) subscription configuration from any IP family.

Source

pub fn ssm(group: Ipv4Addr, source: Ipv4Addr, port: u16) -> Self

Creates an SSM ((S, G)) subscription configuration.

Source

pub fn ssm_v6(group: Ipv6Addr, source: Ipv6Addr, port: u16) -> Self

Creates an IPv6 SSM ((S, G)) subscription configuration.

Source

pub fn ssm_ip(group: IpAddr, source: IpAddr, port: u16) -> Self

Creates an SSM ((S, G)) subscription configuration from any IP family.

Trait Implementations§

Source§

impl Clone for SubscriptionConfig

Source§

fn clone(&self) -> SubscriptionConfig

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 SubscriptionConfig

Source§

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

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

impl Eq for SubscriptionConfig

Source§

impl PartialEq for SubscriptionConfig

Source§

fn eq(&self, other: &SubscriptionConfig) -> 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 SubscriptionConfig

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.