Skip to main content

UdpTransport

Struct UdpTransport 

Source
pub struct UdpTransport { /* private fields */ }
Expand description

The UDPv4 sockets of one participant.

Implementations§

Source§

impl UdpTransport

Source

pub fn open(config: &UdpConfig) -> Result<(UdpTransport, Incoming)>

Opens the sockets, joins the multicast group and starts receiving.

Source

pub fn injector(&self) -> Sender<Datagram>

A sender of datagrams to this transport’s Incoming, for another transport (shared memory) to deliver there too.

Source

pub fn domain_id(&self) -> u32

The domain id.

Source

pub fn participant_id(&self) -> u32

The participant id that was chosen.

Source

pub fn discovery_unicast_locators(&self) -> Vec<Locator>

Where other participants reach this one’s built-in endpoints by unicast (metatrafficUnicastLocatorList).

Source

pub fn discovery_multicast_locators(&self) -> Vec<Locator>

metatrafficMulticastLocatorList: the group on the discovery multicast port.

Source

pub fn user_unicast_locators(&self) -> Vec<Locator>

defaultUnicastLocatorList: where user endpoints are reached by unicast.

Source

pub fn user_multicast_locators(&self) -> Vec<Locator>

defaultMulticastLocatorList: the group on the user multicast port.

Source

pub fn send(&self, data: &[u8], to: &Locator) -> Result<()>

Sends one message to a locator. Multicast destinations are sent on every configured interface.

Locators that are not UDPv4 are refused with io::ErrorKind::Unsupported.

Trait Implementations§

Source§

impl Debug for UdpTransport

Source§

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

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

impl Drop for UdpTransport

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.