Skip to main content

SocketPacketWriting

Trait SocketPacketWriting 

Source
pub trait SocketPacketWriting: SocketOperation {
    // Required method
    fn socket_packet_writer<'scheduler>(
        &'scheduler self,
        socket: &Self::Socket,
    ) -> Result<impl SocketPacketWriter + 'scheduler + use<'scheduler, Self>>
       where Self: Sized,
             Self::Socket: 'static;
}
Expand description

Construct sequential packet output bound to this scheduler. Separate reader and writer handles permit concurrent reception and sending; backends can choose their own static writer.

The returned handle may borrow the scheduler, but never the temporary socket reference. It retains backend access independently, so the socket and handle can move together. Retire and drop handles before exclusively closing the socket.

Required Methods§

Source

fn socket_packet_writer<'scheduler>( &'scheduler self, socket: &Self::Socket, ) -> Result<impl SocketPacketWriter + 'scheduler + use<'scheduler, Self>>
where Self: Sized, Self::Socket: 'static,

Construct a packet writer for socket without performing payload I/O. Stream sockets are rejected.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§