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 open_with( config: &UdpConfig, user: Option<UserHandler>, ) -> Result<(UdpTransport, Incoming)>

Like Self::open, with user traffic given to user on the receiving threads (see Sink).

Source

pub fn injector(&self) -> Sink

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 unicast_addresses(&self) -> &[Ipv4Addr]

The IPv4 addresses this transport’s unicast locators carry.

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§

§

impl !RefUnwindSafe for UdpTransport

§

impl !UnwindSafe for UdpTransport

§

impl Forget for UdpTransport

§

impl Freeze for UdpTransport
where *const u8 is !null: Freeze, PhantomData<Ipv4Addr>: Freeze, *const ArcInner<UdpSocket> is !null: Freeze, PhantomData<ArcInner<UdpSocket>>: Freeze, PhantomData<UdpSocket>: Freeze, *const ArcInner<Atomic<bool>> is !null: Freeze, PhantomData<ArcInner<Atomic<bool>>>: Freeze, PhantomData<JoinHandle<()>>: Freeze, *mut Counter<Channel<Datagram>>: Freeze, *mut Counter<Channel<Datagram>>: Freeze, *mut Counter<Channel<Datagram>>: Freeze, *const ArcInner<dyn Fn(Datagram) -> Option<Datagram> + Sync + Send> is !null: Freeze, PhantomData<ArcInner<dyn Fn(Datagram) -> Option<Datagram> + Sync + Send>>: Freeze, *const ArcInner<Atomic<usize>> is !null: Freeze, PhantomData<ArcInner<Atomic<usize>>>: Freeze,

§

impl Move for UdpTransport

§

impl Send for UdpTransport
where RawVecInner: Send, Arc<UdpSocket>: Send, I32NotAllOnes: Send, Arc<Atomic<bool>>: Send, JoinHandle<()>: Send, SyncSender<Datagram>: Send, Arc<dyn Fn(Datagram) -> Option<Datagram> + Sync + Send>: Send, Arc<Atomic<usize>>: Send,

§

impl Sync for UdpTransport
where RawVecInner: Sync, Arc<UdpSocket>: Sync, I32NotAllOnes: Sync, Arc<Atomic<bool>>: Sync, JoinHandle<()>: Sync, Sender<Datagram>: Sync, Arc<dyn Fn(Datagram) -> Option<Datagram> + Sync + Send>: Sync, Arc<Atomic<usize>>: Sync,

§

impl Unpin for UdpTransport
where *const u8 is !null: Unpin, Arc<UdpSocket>: Unpin, I32NotAllOnes: Unpin, Arc<Atomic<bool>>: Unpin, Arc<Inner, System>: Unpin, Arc<Packet<'static, ()>>: Unpin, *mut Counter<Channel<Datagram>>: Unpin, *mut Counter<Channel<Datagram>>: Unpin, *mut Counter<Channel<Datagram>>: Unpin, Arc<dyn Fn(Datagram) -> Option<Datagram> + Sync + Send>: Unpin, Arc<Atomic<usize>>: Unpin,

§

impl UnsafeUnpin for UdpTransport

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.