Skip to main content

ConnectedDatagramSender

Trait ConnectedDatagramSender 

pub trait ConnectedDatagramSender:
    Debug
    + Send
    + 'static {
    // Required method
    fn poll_send(
        &mut self,
        cx: &mut Context<'_>,
        payload: &[u8],
    ) -> Poll<Result<(), DatagramError>>;

    // Provided method
    fn send_payload(
        &mut self,
        payload: &[u8],
    ) -> impl Future<Output = Result<(), DatagramError>> + Send
       where Self: Sized { ... }
}
Available on crate features std and udp only.
Expand description

A send handle for one established association. Each handle must support independent wakeup. Pending leaves the complete payload with the caller.

Required Methods§

fn poll_send( &mut self, cx: &mut Context<'_>, payload: &[u8], ) -> Poll<Result<(), DatagramError>>

Provided Methods§

fn send_payload( &mut self, payload: &[u8], ) -> impl Future<Output = Result<(), DatagramError>> + Send
where Self: Sized,

Send one complete payload, waiting for room on this association.

Trait Implementations§

§

impl ConnectedDatagramSender for Box<dyn ConnectedDatagramSender>

§

fn poll_send( &mut self, cx: &mut Context<'_>, payload: &[u8], ) -> Poll<Result<(), DatagramError>>

§

fn send_payload( &mut self, payload: &[u8], ) -> impl Future<Output = Result<(), DatagramError>> + Send
where Self: Sized,

Send one complete payload, waiting for room on this association.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§