Struct rudp::Endpoint[][src]

pub struct Endpoint<U: UdpLike> { /* fields omitted */ }

Stateful wrapper around a Udp-like object (facilitating sending of datagrams). Allows communication with another Endpoint object. The Endpoint does not have its own thread of control. Communication is maintained by regular maintain calls that perform heartbeats, resend lost packets etc.


impl<U> Endpoint<U> where
    U: UdpLike

Discard acknowledged outputs, resend lost outputs and send a heartbeat if necessary.

Important traits for Endpoint<U>

Create a new Endpoint around the given Udp-like object, with the given configuration.

Important traits for Endpoint<U>

Create a new Endpoint around the given Udp-like object, with the default configuration.

Attempt to yield a message from the peer Endpoint that is ready for receipt. May block only if the wrapped Udp-like object may block. recv() calls may not call the inner receive, depending on the contents of the inbox.

Fatal errors return Err(_) Reads that fail because they would block return Ok(None) Successful reads return Ok(Some(x)), where x is an in-place slice into the internal buffer; thus, you need to drop the slice before interacting with the Endpoint again.

Convenience function that passes a new SetSender into the given closure. See new_set for more information.

Important traits for SetSender<'a, U>

The Endpoint itself implements Sender, allowing it to send messages. new_set returns a SetSender object, which implements the same trait. All messages sent by this setsender object have the added semantics of relaxed ordering between them.

Trait Implementations

impl<U: Debug + UdpLike> Debug for Endpoint<U>

Formats the value using the given formatter. Read more

impl<U> Sender for Endpoint<U> where
    U: UdpLike

impl<U> Write for Endpoint<U> where
    U: UdpLike

Write a buffer into this object, returning how many bytes were written. Read more

Flush this output stream, ensuring that all intermediately buffered contents reach their destination. Read more

Attempts to write an entire buffer into this write. Read more

Writes a formatted string into this writer, returning any error encountered. Read more

Creates a "by reference" adaptor for this instance of Write. Read more

Auto Trait Implementations

impl<U> !Send for Endpoint<U>

impl<U> !Sync for Endpoint<U>