Skip to main content

base_scheduler/
socket_packet_writing.rs

1// Released under the MIT License.
2// Copyright, 2026, by Samuel Williams.
3
4use crate::{SocketOperation, SocketPacketWriter};
5use std::io;
6
7/// 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.
8pub trait SocketPacketWriting: SocketOperation {
9    fn socket_packet_writer<'scheduler>(
10        &'scheduler self,
11        socket: &Self::Socket,
12    ) -> io::Result<impl SocketPacketWriter + 'scheduler>
13    where
14        Self: Sized,
15        Self::Socket: 'static;
16}